Skip to content
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

Fix word to be a prefix for term issue #798

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

naira-petrosyan-m
Copy link

Issue described in #797

Copy link

vercel bot commented Sep 26, 2024

@naira-petrosyan-m is attempting to deploy a commit to the OramaSearch Team on Vercel.

A member of the Team first needs to authorize it.

@micheleriva
Copy link
Member

Hi @naira-petrosyan-m, thank you for opening this! May I ask you to merge main into your branch? CI was broken and we fixed it, but it's not up to date with your branch.

@micheleriva
Copy link
Member

@naira-petrosyan-m were you able to run tests locally?

@naira-petrosyan-m
Copy link
Author

@naira-petrosyan-m were you able to run tests locally?

@micheleriva actually there are a lot of tests failing where I did not touch anything, I suppose maybe I have some missing parts.

@naira-petrosyan-m
Copy link
Author

naira-petrosyan-m commented Sep 27, 2024

@micheleriva
Your tests are not corresponding to the request of #744 , with term "moelleux" and tolerance 1, both these results need to be there

{ libelle: 'ABRICOT MOELLEUX' },
    { libelle: 'MOELLEUX CHOC BIO' },

I don't think the issue here is with Levenstein, maybe there is an issue somewhere else, that you need to take a look on.

When you play with the test cases

await insertMultiple(index, [
    { libelle: 'ABRICOT MOELLEUX' },
    { libelle: 'MOELLEUX CHOC BIO' },
    { libelle: 'OS MOELLE' },
    { libelle: 'CREPE MOELLEUSE' },
  ])
  
  const s2 = await search(index, {
    term: 'moelleux',
    tolerance: 1,
    threshold: 0
  })

this gives 0 results with my branch and 1 result with main branch, but should give 2 results logically ({ libelle: 'ABRICOT MOELLEUX' },
{ libelle: 'MOELLEUX CHOC BIO' })

await insertMultiple(index, [
    { libelle: 'ABRICOT MOELLEUX' },
    { libelle: 'MOELLEUX CHOC BIO' },
    { libelle: 'OS MOELLE' },
  ])
  
  const s2 = await search(index, {
    term: 'moelleux',
    tolerance: 1,
    threshold: 0
  })

gives correct 2 results (my branch { libelle: 'ABRICOT MOELLEUX' },
{ libelle: 'MOELLEUX CHOC BIO' }) and 1 result (main { libelle: 'OS MOELLE' })

I think there is an issue in _findLevenshtein function, but not sure, please check it when you can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants