Skip to content

Commit ebf8900

Browse files
authored
when using keyword search use proper queries with /q (#47)
1 parent c313b2d commit ebf8900

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/mcp_server_datahub/mcp_server.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,16 +371,21 @@ def enhanced_search(
371371
- Will match: tables named "user_behavior", "client_metrics", "consumer_data" for "customer analytics"
372372
373373
KEYWORD SEARCH (search_strategy="keyword" or default):
374-
- Traditional full-text search matching exact words and phrases
375-
- Fast and precise when you know specific names or technical terms
376-
- Best for: exact entity names, technical identifiers, known column names
377-
- Examples: "user_transactions", "revenue_2024", "customer_id"
378-
- Will match: exact text appearances of these terms
374+
- Structured full-text search - **always start queries with "/q "**
375+
- Supports full boolean logic: AND (default), OR, NOT, parentheses, field searches
376+
- Examples:
377+
• "/q user_transactions" → exact terms (AND is default)
378+
• "/q wizard OR pet" → entities containing either term
379+
• "/q revenue_*" → wildcard matching (revenue_2023, revenue_2024, revenue_monthly, etc.)
380+
• "/q \"user data table\"" → exact phrase matching
381+
• "/q (sales OR revenue) AND quarterly" → complex boolean combinations
382+
- Fast and precise for exact matching, technical terms, and complex queries
383+
- Best for: entity names, identifiers, column names, or any search needing boolean logic
379384
380385
WHEN TO USE EACH:
381386
- Use semantic when: user asks conceptual questions ("show me sales data", "find customer information")
382-
- Use keyword when: user provides specific names ("find table user_events", "show dataset named revenue_jan_2024")
383-
- Use keyword when: searching for technical terms, column names, or exact identifiers
387+
- Use keyword when: user provides specific names ("/q user_events", "/q revenue_jan_2024")
388+
- Use keyword when: searching for technical terms, boolean logic, or exact identifiers
384389
385390
Returns both a truncated list of results and facets/aggregations that can be used to iteratively refine the search filters.
386391
To explore the data catalog and get aggregate statistics, use the wildcard '*' as the query and set `filters: null`. This provides
@@ -417,9 +422,11 @@ def enhanced_search(
417422
418423
SEARCH STRATEGY EXAMPLES:
419424
- Semantic: "customer behavior data" → finds user_analytics, client_metrics, consumer_tracking
420-
- Keyword: "customer_behavior" → finds tables with exact name "customer_behavior"
425+
- Keyword: "/q customer_behavior" → finds tables with exact name "customer_behavior"
426+
- Keyword: "/q customer OR user" → finds tables with either term
421427
- Semantic: "financial performance metrics" → finds revenue_kpis, profit_analysis, financial_dashboards
422-
- Keyword: "financial_performance_metrics" → finds exact table name matches
428+
- Keyword: "/q financial_performance_metrics" → finds exact table name matches
429+
- Keyword: "/q (financial OR revenue) AND metrics" → complex boolean logic
423430
"""
424431
return _search_implementation(query, filters, num_results, search_strategy)
425432

0 commit comments

Comments
 (0)