-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Using querySuggestionsPlugin with Typesense #3
Comments
@MantraMedia The querySuggestionsPlugin is an Algolia specific plugin that's built to work only with their "Query Suggestions" feature. The name sounds generic, but it's actually a feature where they build the suggestions index for you based on query history in a specific index format inside of Algolia. So this plugin requires a document structure in that format. Alternatively, you can build a similar query history index in Typesense by capturing what users type into the search bar, send it to your backend, aggregate, deduplicate and send those to a new collection in Typesense. Then you can query that index from autocomplete.js Another alternative is to just hit your main index and show search results in the autocomplete interface. Here's more context: https://typesense.org/docs/guide/query-suggestions.html |
@jasonbosco Why not natively implement this in the type sense API? Typesense makes it so easy to use search, yet lacks major in-build features. It's exhausting and makes users waste resources if every single typesense user has to implement this process on their end... |
@polarby We recently added built-in analytics in the upcoming version. It’s already available in 0.25.0.rc46 if you want to test it out: https://gist.github.com/jasonbosco/0c49916fc2e7a54f30d961aac111cf4a |
@jasonbosco wow, that might be a game changer. I am excited! |
Hello @jasonbosco What client library would you need to use to automatically populate the top queries? |
@johancoens The search terms are collected and aggregated on the Typesense server-side. So this feature is agnostic to the client-library used. As of 0.25.0, the analytics features does not track the number of results returned, only the count of unique search terms. We plan to add this in the release after the upcoming one. |
I am not sure if this is the same problem as typesense/typesense#570 but I can not get the suggestion plugin to work with Typesense.
I think the problem is that it does not have a
getSources
functionality to override AlgoliaThe error passing the client directly is:
Cannot read properties of undefined (reading 'addAlgoliaAgent')
I somehow could go further in passing
searchClient: typesense.collections('test_index').documents()
and adding the needed
q
parameter in getSearchParams:but this results in an error as the format from Algolia is different
0: {"indexName":"test_index","query":"","params":{"hitsPerPage":5,"highlightPreTag":"__aa-highlight__","highlightPostTag":"__/aa-highlight__","q":"*"}}
Did somebody ever get the querySuggestionsPlugin to work with Typesense?
The text was updated successfully, but these errors were encountered: