Hello everyone, I am exited to test <https://types...
# community-help
m
Hello everyone, I am exited to test https://typesense.org/docs/0.25.0/api/analytics-query-suggestions.html#list-all-rules But a bit confused how it will work. Example: search_requests = { 'searches': [ { 'collection': 'job_queries', 'q': 'php', 'query_by' : 'q' }, { 'collection': 'alljobs', 'q': 'php', 'query_by' : 'title,job_responsibility', 'include_fields': 'title,id' } ] } # Search parameters that are common to all searches go here common_search_params = { } x = client.multi_search.perform(search_requests, common_search_params) First collection returns 0 hits always What I am missing?
k
I don't follow you. Are you saying that the
job_queries
collection is empty?
m
Yes, collection is empty
k
Can you post the exact steps you did to configure analytics rules?
m
Already a collection "alljobs" has data So i added another collection and rules Here is the python django related code
k
Can you try on a stand-alone example using the documentation and see if that works?
m
Actually I tried to find out an example of this from typesense's github examples. But I am confused when the search queries are stored ? Or how do I index search queries? Does multi search does that parallelly ?
https://typesense.org/docs/0.25.0/api/analytics-query-suggestions.html#remove-a-rule According to this query suggestions will come from search_query_collection right?
k
m
Yes i have created search_query_collection first, then I have added a rule to attach with another collection containing data But after doing multi search search_query_collection returns 0 hits
k
Please provide a stand alone python snippet that I can run to reproduce the problem. Otherwise it's hard to figure out what could be going wrong.
m
Thank you , I will share a standalone script
👍 1
It is working I found it here I didn't know that in configuration that feature has be to turned on https://gist.github.com/jasonbosco/0c49916fc2e7a54f30d961aac111cf4a
k
Yes, need to enable the flag when you start the Typesense server.
Isn't that mentioned in the docs? If so, we will have to make it clear.
m
Yes it was, I didn't noticed it, jumped straight on the https://typesense.org/docs/0.25.0/api/analytics-query-suggestions.html page.
Thank you for the support
This page can have a warning at the beginning about turning on that feature is mandatory https://typesense.org/docs/0.25.0/api/analytics-query-suggestions.html#create-a-collection-for-aggregation
👍 1
k
Welcome!
m
Does the query analytic manager removes similar ones ? I mean is there any semantic analysis ? For names probably it won't work but for sentences ?
k
No we don't have a way to duplicate at the moment. Generally when you have enough traffic the typos will be a small fraction and the popular queries will automatically surface.
m
That's a good point. Thanks
I tried it, it works well but it stores empty strings even with three white spaces it stores separately Initially default search page starts with * as query keyword so it counts it as a query but empty spaces are also inserted and counted. Frontend validation can be added though.
k
Thanks for pointing this out: can you please create an issue on Github for us to track?
m
k
Thanks, will update the issue when a fix is ready.
❤️ 1