Experimental CONTAINS
and STARTS WITH
filter operators
#763
Replies: 7 comments 22 replies
-
Hello, I’ve been using the CONTAINS filter functionality for some time, as well as the new Federation feature in the current RC version (v1.10.0-rc.1). Personally, I would like to have a feature similar to the following: Performing a search on the same index for multiple content items and aggregating the returned results (with optional AND or OR logic):
POST /indexes/{indexUid}/multi-search
{
"queries": [
{
"q": "hello",
"attributesToSearchOn": ["header"]
"filter": "id < 100"
},
{
"q": "world",
"attributesToSearchOn": ["footer"]
"filter": "id > 0"
},
],
"offset": 0,
"limit": 20
} The key here is to simultaneously search on different attributes for different content(
|
Beta Was this translation helpful? Give feedback.
-
This feature turns out to be very useful in our case! We are implementing a search UI with several fields, in order to let the user search for documents that have, say, "chaussier" in the New operators like STARTS_WITH and ENDS_WITH could be a nice complement to CONTAINS, but CONTAINS would still be relevant and useful. An SQL-like Something that I would love to have would be error tolerance (and maybe other "search" stuff) in filters on text fields. Or a way to do this kind of queries (checking different fields for different keywords) with regular search, which includes error tolerance, synonyms, etc. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone 👋 We have just released the first RC (release candidate) of Meilisearch containing the
You are welcome to leave your feedback in this discussion. If you encounter any bugs, please report them here. 🎉 Official and stable release containing this change will be available on |
Beta Was this translation helpful? Give feedback.
-
Hi, @macraig is CONTAINS available in the Javascript SDK? |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I'm wondering how to handle CONTAINS with two or more words. Is the only way to use two separate filters with 'AND'? |
Beta Was this translation helpful? Give feedback.
-
Hey folks 👋 v1.11 has been released! 🐿️ You can now use the STARTS WITH filter 🎉 Looking forward to your feedback! ✨ |
Beta Was this translation helpful? Give feedback.
-
Yay! Next up: ENDS_WITH ? |
Beta Was this translation helpful? Give feedback.
-
CONTAINS
andSTARTS WITH
filter operatorsMeilisearch v1.10.0 (released on August 26, 2024) introduces a new
CONTAINS
filter operator.Experimental feature abstract
Enabling the experimental feature will make two new operators available, the
CONTAINS
andSTARTS WITH
ones, while filtering on strings.The
CONTAINS
one is similar to the SQLLIKE
operator used in that way%venture%
and theSTARTS WITH
one is like usingvent%
.How to use the feature?
--experimental-contains-filter
or call thePATCH /experimental-features
passing"containsFilter": true
./indexes/movies/search
route with your parameters:💡 More information about
CONTAINS
and aboutSTARTS WITH
on their dedicated usage pages.Why is this feature not stable yet?
The aspect we are most concerned about with this feature is search performance.
Indeed, it is possible that
CONTAINS
andSTARTS WITH
perform poorly, given your dataset. The time to find the documents matching a query with these operators increases with the total number of bytes of all the facet values of all the documents in an index.We would like to hear your feedback on this feature, and we would also like your input on the following questions to help us decide on a go-no-go decision for the stabilization of that feature in the future:
q
parameter to solve your need for aCONTAINS
operator, and if not, why?CONTAINS
operator, and if not, why?🗣️ You are welcome to give feedback or ask any question on its usage; we are eager to collect feedback on the feature
Beta Was this translation helpful? Give feedback.
All reactions