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

Autocomplete search #45

Open
voslartomas opened this issue Apr 10, 2024 · 4 comments
Open

Autocomplete search #45

voslartomas opened this issue Apr 10, 2024 · 4 comments

Comments

@voslartomas
Copy link
Contributor

Hello, is it somehow possible to use autocomplete search?

{
    "$search": {
      "autocomplete": {
        "query": `${request.query.term}`,
        "path": "name",
        "fuzzy": {
          "maxEdits": 2,
          "prefixLength": 3,
        },
      },
    },
  },

This will fail with error like this

unknown top level operator: $search. If you have a field name that starts with a '$' symbol, consider using $getField or $setField.
@ExtraBB
Copy link
Owner

ExtraBB commented Apr 10, 2024

Not currently, but feel free to raise a PR adding the functionality!

@voslartomas
Copy link
Contributor Author

I think it would need support for aggregate instead of simple find. Any advice on this? Or you think it will be simple to implement? I would create PR

@voslartomas
Copy link
Contributor Author

Here it is @ExtraBB #46

@ExtraBB
Copy link
Owner

ExtraBB commented Apr 30, 2024

@voslartomas Great! Thanks for the contribution. I left some comments on the PR.

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