You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/holoviz_mcp/apps/holoviz_search.py
+31-5Lines changed: 31 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,23 @@
41
41
- **`project`**: Filter results by specific project (e.g., "panel", "hvplot", "datashader") or search across all projects
42
42
- **`max_results`**: Control the number of results returned (1-50 documents)
43
43
- **`content`**: Choose whether to include full document content or just metadata for faster responses
44
+
- **`max_content_chars`**: Maximum characters of content per result (100-50,000). Smaller values provide faster responses. Content is truncated at word boundaries with query-relevant excerpts.
45
+
46
+
### Query Optimization Tips
47
+
48
+
For best results with content truncation, use **specific terms** rather than generic phrases:
49
+
50
+
- ✅ **Good**: "Button onClick on_click callback event" - specific class and method names
- ❌ **Avoid**: "how to add pagination to a table" - too generic, common words
53
+
54
+
**Why This Matters**: The search uses context-aware truncation that centers content on your query keywords. Specific terms help the system extract the most relevant sections of documentation.
55
+
56
+
**Best Practices**:
57
+
- Use class/function names: "RangeSlider add_filter" > "filtering with widgets"
58
+
- Use unique identifiers: "background_gradient text_gradient" > "styling colors"
59
+
- Avoid common terms: "pandas", "import", "data" appear everywhere
60
+
- Use multiple specific terms to help locate the right section
44
61
45
62
### What's Indexed
46
63
@@ -84,12 +101,18 @@ class SearchConfiguration(param.Parameterized):
84
101
doc="Filter results to a specific project. Select 'all' for all projects.",
85
102
)
86
103
87
-
max_results=param.Integer(default=5, bounds=(1, 50), doc="Maximum number of search results to return")
104
+
max_results=param.Integer(default=2, bounds=(1, 50), doc="Maximum number of search results to return")
88
105
89
106
content=param.Boolean(
90
107
default=True, label="Include Full Content", doc="Include full document content in results. Disable for faster and simpler responses with metadata only."
91
108
)
92
109
110
+
max_content_chars=param.Integer(
111
+
default=10000,
112
+
bounds=(100, 50000),
113
+
doc="Maximum characters of content per result. Use smaller values for faster responses. Set to None for full content (may cause token limit errors).",
114
+
)
115
+
93
116
search=param.Event(doc="Event to trigger search when parameters change")
94
117
95
118
results=param.List(item_type=Document, doc="Search results as a list of Documents", precedence=-1)
0 commit comments