-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.3: Define search field at search time #2478
Comments
Hello @guimachiavelli,
{
"message": "Invalid value type at `.attributesToSearchOn`: expected an array, but found a string: `\"hello\"`",
"code": "invalid_attributes_to_search_on",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_attributes_to_search_on"
}
{
"message": "Attribute `unknown` is not searchable. Available searchable attributes are: `id, title`.",
"code": "invalid_attributes_to_search_on",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_attributes_to_search_on"
}
{
"message": "Attribute `unknown` is not searchable. Available searchable attributes are: `id, title, <..hidden-attributes>`.",
"code": "invalid_attributes_to_search_on",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_attributes_to_search_on"
} See you! |
Thanks for the clarification, @ManyTheFish! A couple of questions:
|
Hello @guimachiavelli,
No, the behavior to select all attributes is to not define the field or set it to
the default value is |
Hello @guimachiavelli, there is a small change in the error code Meanwhile, I've updated the related specifications, I put below the dedicated PR: Sorry for the late change! See you!
|
No problem, thanks for letting me know (and for updating the draft PR 🙏) |
v1.3 introduces a new search parameter,
attributesToSearchOn
.attributesToSearchOn
is a search parameter accepting an array of strings indicating one or more document attributes. Queries usingattributesToSearchOn
will restrict the search to the indicated attributes.Given the following dataset:
And the following query:
Meilisearch will only return document
1
.Both documents contain the word adventure, but
"attributesToSearchOn": ["genre"]
instructs Meilisearch to only consider results found on thegenre
field.Tasks
attributesToSearchOn
to/reference/api/search#search_parameters
/reference/api/search
and/reference/api/multi_search
<Capsule />
mentioningattributesToSearchOn
to/learn/fine_tuning_results/filtering
References
The text was updated successfully, but these errors were encountered: