Giter VIP home page Giter VIP logo

Comments (4)

dureuill avatar dureuill commented on June 26, 2024

Hello 👋

In your provided query "Kasu Taisto", looks like the first word is a prefix of Kasurinen from the documents.

Prefix search is only applied on the last query term, even with the all matching strategy.

Looking for Kasurinen Taisto does return the expected hit.

I can see why the behavior is surprising. Applying prefix search only to the last term is for performance reasons

from meilisearch.

mdostmann avatar mdostmann commented on June 26, 2024

Hi @dureuill and thank you for your response.
I think I do not get how this is supposed to work. E.g., searching for "Ted John" will return documents where both terms match, same for "Irving John".
"Irvi John", on the other hand, does not match any document.
"Taisto miner Finnish Kasu" does match, as does "Taisto miner Finnis Kasu" but not "Taisto miner Finn Kasu".

This is probably the intended behaviour, although I'm having a rough time figuring out what I can expect to match, especially due to this blog: "This matching strategy is called: all because all query terms must be present in the document for it to be returned."

The examples above all query terms that seem to be present and proper prefixes.

Is this really the intended behaviour?

from meilisearch.

dureuill avatar dureuill commented on June 26, 2024

Let's break down what happens in all the cases you're mentioning. When trying to understand relevancy, it can help to enable showRankingScoreDetails which will give some information on which rules where applied.

The TL;DR is that there are multiple effects at work, prefix is one of them, but there's also typo tolerance (which will depend on the length of words and the number of missing letters) and ngrams (can't find docs about them right now but the intuition is that they will help you find documents when the space is at the wrong location, e.g. finding documents for "batman" when querying "bat man").

  • "Ted John" and "Irving John" -> both words are in documents
  • "Irvi John" -> Unlikely to have documents containing "Irvi". Going to "Irving" via typo requires two typos, in default settings this triggers only for words with 9 letters
  • "Taisto miner Finnish Kasu" -> prefix on Kasu
  • "Taisto miner Finnis Kasu" -> prefix on Kasu + one typo on "Finnish" (one typo triggers for words of 5+ characters in the query in default settings)
  • "Taisto miner Finn Kasu" -> prefix on Kasu, too many typos to go back to Finnish.

Is this really the intended behaviour?

Yes. If you don't want typo tolerance, you can disable it. However it is generally useful to humans typing queries.

from meilisearch.

curquiza avatar curquiza commented on June 26, 2024

I close this issue due to a lack of answers. Nothing is definitive of course, feel free to ask to re-open if needed 😊

from meilisearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.