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

update $text mongo intexing -- Ngram? #47

Open
devincowan opened this issue Mar 21, 2023 · 2 comments
Open

update $text mongo intexing -- Ngram? #47

devincowan opened this issue Mar 21, 2023 · 2 comments

Comments

@devincowan
Copy link
Collaborator

devincowan commented Mar 21, 2023

@ergjustin has found this bug when implementing users filters as in:
https://github.com/DendraScience/dendra-web-ui/blob/dev-justin/src/components/UsersSearch.vue#L199

$regex: "${escapeRegExp(search)}"

@devincowan
Copy link
Collaborator Author

We thought we needed to create a mongo text index for email full_name and name but turns out there already was one

appDb.users.createIndex(
      {
        email: 'text',
        full_name: 'text',
        name: 'text'
      },
      {
        name: 'text_index'
      }
    );

@devincowan
Copy link
Collaborator Author

so we decided to leave our regex searches as is for now and we will implement a better (Ngram?) search later

Implement n-grams for partial full-text search! https://en.wikipedia.org/wiki/N-gram

@devincowan devincowan changed the title need to patch the $regex to fix int typeError update $text mongo intexing -- Ngram? Mar 21, 2023
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

No branches or pull requests

2 participants