Comments (7)
The second issue described is also an expected behavior, when you use phrase search (you enclose your query terms in "
) Meilisearch will return documents containing all those query terms. In your case, documents containing both bot
and test
.
If you want to find all documents containing bot
and/or test
, you should not enclose them in double quotes:
client.index('movies').search('bot test').then((res) => console.log(res))
from meilisearch.
Hello @anh1
This is an expected behavior. Indeed, there is a special case with the « . » and the « , » due to the « number » support like « 1.2 ».
When there is no space after « . » or « , » the separator is not considered a context separator (aka hard separator). However, putting a blank space after the separator will be considered as you expect
For instance
octavia.butler
-> "octavia butler"
octavia. butler
-> "octavia" "butler"
from meilisearch.
octavia. butler
when i run client.index('movies').search('bot test').then((res) => console.log(res)), i get 2 results.
when i run client.index('movies').search('test bot').then((res) => console.log(res)), i get 219 results.
should both run return the same amount documents?
from meilisearch.
Meilisearch uses by default the "last matching strategy": it returns documents containing all the query terms first, then Meilisearch will remove one query term at a time, starting from the end of the query.
For client.index('movies').search('bot test').then((res) => console.log(res))
It will first search for documents containing both query words, 'bot' and 'test', then it will search for results containing just 'bot'.
For client.index('movies').search('test bot').then((res) => console.log(res))
t will first search for documents containing both query words, 'bot' and 'test', then it will search for results containing just 'test'.
You can fin more info on matching strategy in the documentation
from meilisearch.
Meilisearch uses by default the "last matching strategy": it returns documents containing all the query terms first, then Meilisearch will remove one query term at a time, starting from the end of the query.
For
client.index('movies').search('bot test').then((res) => console.log(res))
It will first search for documents containing both query words, 'bot' and 'test', then it will search for results containing just 'bot'.For
client.index('movies').search('test bot').then((res) => console.log(res))
t will first search for documents containing both query words, 'bot' and 'test', then it will search for results containing just 'test'.You can fin more info on matching strategy in the documentation
Okay. But from a user perspective, when I type in "bot test" or "test bot", I expect all documents containing test or bot to be returned. I wouldn't think the result would contain only "bot" and not "test" or vice versus. If I do a search "bot test", and only receive 2 results containing "bot", then I would assume there are no movies with the word "test" in it which is not the case.
from meilisearch.
Hey,
You are not the only want that would like another behavior. In fact, we have an open product discussion about the subject.
There are currently two matching strategies: all and last. In the discussion linked above, there are others listed, it would be great if you could give your opinion/vote, it greatly helps us shape the product and prioritise features 🙏
from meilisearch.
Since both of the issues described align with the expected Meilisearch behavior, I am going to close this issue. Thank you for bringing this to our attention 🙏
from meilisearch.
Related Issues (20)
- Federated search
- Tasks processing seems to block at some point
- Language settings
- Document DB compression
- Exp - Update documents with a function
- Upgrade dependencies
- Improve usage of the rest embedder HOT 3
- Vector store feature: improve test coverage HOT 2
- [investigation] LMDB RAM consumption is not restricted HOT 1
- RFC: make `documentTemplate` mandatory and remove `{{fields}}` syntax
- Missing apt package for ubuntu jammy HOT 1
- Improve the intersection and unions in the search pipeline
- Update minimal ubuntu version supported by Meilisearch
- Stop opening indexes to only check if they exists HOT 1
- [Experimental] Webhook and health route improvements
- Catch the `MDB_TXN_FULL` error and reduce the batch size to eventually succeed
- Meilisearch: Self-hosted cloud deployment network connection stalling
- About two major LMDB optimisation tricks HOT 1
- Update version in Cargo.toml for v1.8.4 HOT 1
- AI quality-of-life improvements for v1.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meilisearch.