-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Introduce the filter syntax for CONTAINS
, STARTS
and ENDS WITH
#3751
base: main
Are you sure you want to change the base?
Conversation
ceb34ed
to
bdcee66
Compare
74336cf
to
72f4b8f
Compare
66d3389
to
5e12ed3
Compare
This issue is so important for us. When will it be released? Thanks, |
Hello @GelistirmeKF Thanks for letting us know. What is your use case exactly? You need this feature, but can you describe more about what you need? |
Hi @curquiza, I mentioned it in this meilisearch/product#544 and but didn't get any response. Thanks in advance, |
When will this be available? |
Hello everyone This feature is not planned yet. We encountered performance issues when we created this prototype Thank you in advance |
Hi Any news about this feature? |
Hello @james2001 It's not planned at the moment As a reminder, this PR discussion is for technical details 😊 |
This PR introduces three filters. These filters give more control over the facet string values, with can be powerful in certain situations. Keep in mind that there are performance issues with both the
CONTAINS
andENDS WITH
filters. It is algorithmically impossible to fix theCONTAINS
one.Related to meilisearch/product#544.
Mini Spec
The
CONTAINS
filter📝 Can't be improved
CONTAINS
matches fields thatEXISTS
and contains a specific string insideNOT CONTAINS
matches fields thatNOT EXISTS
OR do not contain a specific string{"name":"A", "company": "Airbus 2000"}
{"name":"B", "company": "Tesla Inc"}
{"name":"C", "company": "Meilisearch"}
{"name":"D"}
company CONTAINS 'meilisearch'
would match 3company NOT CONTAINS "meilisearch"
orNOT company CONTAINS meilisearch
would match 1,2,4company CONTAINS a
would match 1,2,3company NOT CONTAINS microsoft
orNOT company CONTAINS microsoft
would match 1,2,3,4common query :
(company CONTAINS meilisearch) OR (company NOT EXISTS)
would match 3,4The
STARTS WITH
filter📝 Can be sped up by using the levels/layers structures
STARTS WITH
matches fields thatEXISTS
and starts with a specific string insideNOT STARTS WITH
matches fields thatNOT EXISTS
OR do not starts with a specific string{"name":"A", "company": "Airbus 2000"}
{"name":"B", "company": "Tesla Inc"}
{"name":"C", "company": "Meilisearch"}
{"name":"D"}
company STARTS WITH 'meili'
would match 3company NOT STARTS WITH "meili"
orNOT company STARTS WITH meili
would match 1,2,4company STARTS WITH a
would match 1,2,3company NOT STARTS WITH micro
orNOT company STARTS WITH micro
would match 1,2,3,4common query :
(company STARTS WITH meili) OR (company NOT EXISTS)
would match 3,4The
ENDS WITH
filter📝 Can be improved by duplicating the entire database and swap the strings chars
ENDS WITH
matches fields thatEXISTS
and ends with a specific string insideNOT ENDS WITH
matches fields thatNOT EXISTS
OR do not ends with a specific string{"name":"A", "company": "Airbus 2000"}
{"name":"B", "company": "Tesla Inc"}
{"name":"C", "company": "Meilisearch"}
{"name":"D"}
company ENDS WITH 'search'
would match 3company NOT ENDS WITH "search"
orNOT company ENDS WITH search
would match 1,2,4company ENDS WITH a
would match 1,2,3company NOT ENDS WITH soft
orNOT company ENDS WITH soft
would match 1,2,3,4common query :
(company ENDS WITH search) OR (company NOT EXISTS)
would match 3,4Todo List