Hello! I'm running into an issue with analytics wh...
# community-help
i
Hello! I'm running into an issue with analytics where 'q' is always stored as an empty string in destination collections, even though 'count' increments correctly. This affects both
popular_queries
and
nohits_queries
rules. Setup: • Typesense server 30.1 • SDK typesense-js 3.0.3 • Searches are performed via multiSearch against an alias (e.g.
uk_products
) which points to an underlying collection (e.g.
uk_products_1774281307995
) • Analytics rules reference the alias name in the collection field Behaviour: • I've only just hopped onto this, but it looks like analytics was working correctly at some point - we have documents in collections with correctly captured q values (e.g.
q: "test"
,
q: "xxx"
) • At some point it stopped working and all searches now increment a single document with
q: ""
instead of their own q value • This affects all searches regardless of whether they return results or not • 'count' increments correctly so the rule is clearly matching searches, but q is never extracted What we've ruled out: • Rule misconfiguration - structure is identical to when it was working • Destination collection schema - q is correctly defined as a non-optional string • multiSearch being the cause - reproduced with a direct single search Has anyone seen this before? Could a reindex/alias update cause this? Happy to provide more details.
This what is coming through in the dashboard
f
Hey Issy, This could also be just wildcard searches (
q=*
). Are you sure nothing else is being saved on that destination collection?
i
Hi Fanis, I have run quite a few test queries with explicit query strings like "test" and this still increments count for the empty q entry. Testing
q: "test"
increments the empty q entry, even though there is a bucket where q = test that was previously created
f
Could you try recreating the analytics rule? Can you reproduce this in a clean Typesense instance?
i
It might be hard to test locally with a clean typesense instance, but I've recreated the rules multiple times today with no change in behaviour. On the clean instance question - is there something specific about an existing instance that could cause this? Could stale analytics data in the destination collection be causing new searches to aggregate into the existing empty q document rather than creating new ones??
a
Hi Issy, Are you in cloud or self hosted? If you are self hosted, could you export a snapshot of your cluster + a script that creates the rules and verify that they dont work?
r
I’m currently experiencing this issue and stumbled into this thread. I wonder if they found out what’s the issue. I got separate count for q=* and q=“” but i don’t have any query that sends empty
q
request
f
Hey @Ralph Marinay , Are you on Typesense cloud or self-hosting?
r
@Fanis Tharropoulos We’re on self-hosting
f
Can you create a reproduction script like this one: https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b so we can debug?