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
Add hybrid search support to Meilisearch MCP server
- Update meilisearch dependency from >=0.33.0 to >=0.34.0 for stable AI-powered search
- Add hybrid search parameters to search tool schema:
- hybrid object with semanticRatio and embedder fields
- vector parameter for custom vectors
- retrieveVectors parameter to include vectors in results
- Update client.py search method to pass new parameters to SDK
- Add comprehensive tests for hybrid search functionality
- Update README with hybrid search examples and documentation
This enables users to leverage Meilisearch's semantic and hybrid search capabilities
through the MCP interface, combining traditional keyword search with AI-powered
semantic search for more relevant results.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,13 +133,13 @@ Example usage through MCP:
133
133
134
134
### Search Functionality
135
135
136
-
The server provides a flexible search tool that can search across one or all indices:
136
+
The server provides a flexible search tool that can search across one or all indices with support for hybrid search (combining keyword and semantic search):
137
137
138
138
-`search`: Search through Meilisearch indices with optional parameters
139
139
140
140
Example usage through MCP:
141
141
```json
142
-
// Search in a specific index
142
+
// Traditional keyword search in a specific index
143
143
{
144
144
"name": "search",
145
145
"arguments": {
@@ -149,6 +149,31 @@ Example usage through MCP:
149
149
}
150
150
}
151
151
152
+
// Hybrid search combining keyword and semantic search
153
+
{
154
+
"name": "search",
155
+
"arguments": {
156
+
"query": "artificial intelligence",
157
+
"indexUid": "documents",
158
+
"hybrid": {
159
+
"semanticRatio": 0.7,
160
+
"embedder": "default"
161
+
},
162
+
"limit": 20
163
+
}
164
+
}
165
+
166
+
// Semantic search with custom vector
167
+
{
168
+
"name": "search",
169
+
"arguments": {
170
+
"query": "machine learning",
171
+
"indexUid": "articles",
172
+
"vector": [0.1, 0.2, 0.3, 0.4, 0.5],
173
+
"retrieveVectors": true
174
+
}
175
+
}
176
+
152
177
// Search across all indices
153
178
{
154
179
"name": "search",
@@ -167,6 +192,13 @@ Available search parameters:
167
192
-`offset`: Number of results to skip (optional, default: 0)
168
193
-`filter`: Filter expression (optional)
169
194
-`sort`: Sorting rules (optional)
195
+
-`hybrid`: Hybrid search configuration (optional)
196
+
-`semanticRatio`: Balance between keyword (0.0) and semantic (1.0) search (optional, default: 0.5)
197
+
-`embedder`: Name of the configured embedder to use (required when using hybrid)
198
+
-`vector`: Custom vector for semantic search (optional)
199
+
-`retrieveVectors`: Include vector data in search results (optional)
200
+
201
+
**Note**: To use hybrid search features, you need to have an embedder configured in your Meilisearch index settings. Refer to the [Meilisearch documentation on vector search](https://www.meilisearch.com/docs/learn/vector_search/vector_search_basics) for configuration details.
-`add-documents`: Add or update documents in an index
211
243
212
244
### Search
213
-
-`search`: Flexible search across single or multiple indices with filtering and sorting options
245
+
-`search`: Flexible search across single or multiple indices with support for hybrid search (keyword + semantic), custom vectors, and filtering/sorting options
214
246
215
247
### Settings Management
216
248
-`get-settings`: View current settings for an index
description="Search through Meilisearch indices. If indexUid is not provided, it will search across all indices.",
214
+
description="Search through Meilisearch indices with support for hybrid search (combining keyword and semantic search). If indexUid is not provided, it will search across all indices.",
0 commit comments