Policy for matching words #255
Replies: 21 comments 29 replies
-
I would like to add some input on how policies for matching words could be used and help solve some of our problems. In our case, we are using MeiliSearch on a large text database and found that searching by "all words", "any word", and "exact phrase" provide the best results, as our users often search for quotes (or parts of a quote) that they remember the words for exactly (minus spelling mistakes and case sensitivity). So perhaps policies like We found after our testing that the normal search works like an "any word" search and returns and result that has some of those words sorted by relevancy. While phrase search words a lot more like "all word" search at the moment and returns results that contain those words throughout the document. We are having trouble creating an "exact phrase" search, that only returns results with the exact phrase only, without gaps or other words in the middle. So for instance if you searched for For example, we are trying to re-create these search results in MeiliSearch: In this example of exact phrase search above, you can see only one result was returned out of around 65,000 paragraphs. This is a common way people use the search if they remember certain words from a quote and try find the full paragraph of what was said. Perhaps a stricter policy on phrase search could probably achieve this same result... This example above of "all words" search seems to be like the results we are currently getting from phrase search, as all the words exist in the document. So a useful feature that could probably be achieved with an The last example of "any word" search works like the default Meilisearch and we're happy with that so far. This seems to match the We don't really see any case for |
Beta Was this translation helpful? Give feedback.
-
I'll just add my two cents here, as we're currently unable to upgrade from v0.20.0 due to the fact that later versions return results regardless of how many terms match the document. We have a search field with an autocomplete that can deliver three Currently (v0.20.0), if a user enters a multi-word query where only one word matches a document, no results are returned. This is desired behaviour from our end, and if I understand correctly would be possible if the Later versions do match only "Restaurants" though, meaning the default behaviour has changed to work like the We'd love to have the option to choose the matching policy per request. Although I do realise that our issues could be resolved in other ways, like the possibility to limit results per facet or even multi-index search where we separate the types into different indexes altogether. |
Beta Was this translation helpful? Give feedback.
-
I would add here, we should also define the default behavior we want :) Also, we should consider the impact on search speed. We are not sure this is related but in v0.19.0 we noticed better search performance than for v0.21.0 and later. |
Beta Was this translation helpful? Give feedback.
-
I'm using 0.25.2. If I make a multi word search (n words), I get the results with all the words first and then I get results with some or one of the words. I would like a situation where I only get the results with all the words, but if there are not results with all the words, I then get the results with n-1 words. If there are no n-1 results, I should get the n-2 words, and so on. I tried using the parenthesis around each word suggestion but that stops fuzzy search, so it doesn't catch typos or even plurals. Thanks for a great package! |
Beta Was this translation helpful? Give feedback.
-
Almost. If there were 3 words in the search but no full match, I would like to get all the matches with every combination of 2 words. And I would like fuzzy search to work especially for plurals. |
Beta Was this translation helpful? Give feedback.
-
Hi all. Definitely something that would be very useful on a per-usecase basis. Even more on a per-query basis if possible. It all boils down to the formal view that the more options developers have to specify a search behavior, the better they can solve customers problems, which are essentially infinite! Thank you @gmourier for the proposal. Keep up the good work. |
Beta Was this translation helpful? Give feedback.
-
Hi, In addition to what others said, my suggestion would be a min/max number of results IF the query has been "transformed" (words removed). For example, say i want minimum 100 results, and a maximum of 200 if the query was transformed. If the query with all words matches 120 results, just return them. If the query with all words matches only 50 results, the last word will be removed from the query. I don't know if i explained well my needs but I really hope this could be possible ! 😄 |
Beta Was this translation helpful? Give feedback.
-
Hello everyone here! 👋 We are working on introducing the relevancy customization during the search with Meilisearch, and we just released a first prototype that allows you, for example, only to return documents containing ALL the query words! 🔥 It would be super helpful if you could let us know if this helps with your issue. |
Beta Was this translation helpful? Give feedback.
-
Hello 👋 We have just released v0.29.0rc1, which is a release candidate of v0.29.0 🔥 It introduces a new search parameter named For now, it accepts 2 strategies:
Binaries are attached to the release, or you can use the docker image: docker run -it --rm \
-p 7700:7700 \
getmeili/meilisearch:v0.29.0rc1 Let us know about any bugs or feedback! 😄 It would be really helpful. FYI, the official v0.29.0 release will be available on 3rd October. |
Beta Was this translation helpful? Give feedback.
-
Hello folks 👋 v0.29 release is finally out. 🔥 It brings the
If you were stuck in a version earlier than v0.21.0 because it was critical for you to have the This discussion remains open to discuss other strategies that we could implement in the future. Thank you ✨ |
Beta Was this translation helpful? Give feedback.
-
I would really appreciate something along the lines of "optional" for query terms. It's especially useful in fashion since users don't usually put the most important terms first and they may even search for multiple colors using the search box. Is there an ETA on when this feature could be released? |
Beta Was this translation helpful? Give feedback.
-
"Optional" matching strategy would be really useful. Sadly, default "last" strategy has the effect of giving to first word within search query kind of exclusive-priority, since it becomes mandatory for a document to be returned. What if, searching for "one two three", I would like to get documents containing "two three four" or "three four five"? |
Beta Was this translation helpful? Give feedback.
-
@irevoire @curquiza Hello, sorry to tag you guys; but it's been nearly 6 months since we got the last update in meilisearch/meilisearch#4093. Any movement on this one yet? Again, this is pretty important stuff! |
Beta Was this translation helpful? Give feedback.
-
I have to admit that the lack of effort in this area is a real enigma, given the quality of the rest of the work. But unfortunately, without it, the product can't claim to compete with elasticsearch (although that's what it seems to claim when you read the doc/blog resources). Hope it will change someday ;) |
Beta Was this translation helpful? Give feedback.
-
We also got issues. We are searching with PS. Those numbers, are ID's from our objects (results).
|
Beta Was this translation helpful? Give feedback.
-
Hi @maiorfi @xamir82 @dtrckd , thank you for submitting your feedback and comments. As I said in one of the messages above, we don't have an ETA on this for now. We are going to include it in our next planning discussions, and I'll make sure to share any updates in this discussion. We understand the importance of this feature and appreciate your understanding as we navigate through our priorities. |
Beta Was this translation helpful? Give feedback.
-
Concerning the so desired "optional" strategy still missing, I was wondering if, taking advantage of some workaround (for example running two searches with "first" and "last" strategies and then somehow merging results both in terms of hits and facets), would it be possible to face the temporary (I hope) lack of that strategy. Any thoughts about that? |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the a great tool we are trying to implement OR search (Optional in above), which should allow us to search by either of the terms, is there any way to implement it? We were trying to implement multi-search, but we have pagination too, so we couldn't figure out how to calculate pagination. So is there any way we can implement it ?
|
Beta Was this translation helpful? Give feedback.
-
Hi everyone, we're happy to announce that we will be shipping a new The upcoming API details can be found here. |
Beta Was this translation helpful? Give feedback.
-
Update: |
Beta Was this translation helpful? Give feedback.
-
Hey folks 👋 v1.9 has been released🦎 and the |
Beta Was this translation helpful? Give feedback.
-
Description
On a search with one or multiple words in the query. The user can choose what happens if a word on a query is not present on the document or the engine has not found enough documents. We could imagine a new setting to define a policy.
Some possibilities:
Introduced asnone
: All terms must be contained in a document to be considered as a search result.all
inv0.29
version.Introduced aslast
: If no document contains all the given terms, the engine removes the last query term and so on.last
inv0.29
version.first
: If no document contains all the given terms, the engine removes the first query term and so on.optional
: All words in a query are always optional;Introduced asfrequency
: If no document contains all the given terms, the engine removes the most common term within the dataset and so on.frequency
in v1.9size
: If no document contains all the given terms, the engine removes the shorter term and so on.EDIT by @curquiza
Adding these issues here for the traceability:
Needing
optional
orfrequency
Beta Was this translation helpful? Give feedback.
All reactions