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

Deleted documents still appear in searches - (through substrings) #52

Closed
thomscoder opened this issue Jul 28, 2022 · 0 comments
Closed
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@thomscoder
Copy link
Contributor

thomscoder commented Jul 28, 2022

Describe the bug
Most likely related to #39 ( @lucaong ). On Lyra 0.0.1-beta-14...

To Reproduce

import { Lyra } from '@nearform/lyra';

const lyra = new Lyra({
  schema: {
    word: "string",
  }
});

const { id: halo } = await lyra.insert({ word: 'Halo' });
const { id: halloween } = await lyra.insert({ word: 'Halloween' });
const { id: greenLantern } = await lyra.insert({ word: 'Hal' });

await lyra.delete(halo);

const search = await lyra.search({
  term: 'Hal',
});

console.log(search);

The results returns an id but no match

{
  elapsed: '164μs',
  hits: [
    { id: 'FUKQeo1l-rnOwzQyHLSlf', word: 'Hal' },
    { id: 'oMk8_x6NpV6siIn6SysEE' },
    { id: '3uv5A8-OCVIxfbwcWzxK7', word: 'Halloween' }
  ],
  count: 3
}

Expected behavior

{
  elapsed: '164μs',
  hits: [
    { id: 'FUKQeo1l-rnOwzQyHLSlf', word: 'Hal' },
    { id: '3uv5A8-OCVIxfbwcWzxK7', word: 'Halloween' }
  ],
  count: 2
}

Screenshot

Screenshot 2022-07-28 152442

@thomscoder thomscoder changed the title deleted documents still appear in searches - (through substrings) Deleted documents still appear in searches - (through substrings) Jul 28, 2022
@mateonunez mateonunez added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants