The did you mean feature will start internally re-running suggested queries. To the existing CirrusSearchRequests log this will still look like there is a no result query requested via web though. https://gerrit.wikimedia.org/r/#/c/224502/ makes a small addition to the logs, an executor id. This uniquely identifies the execution context of a request. Multiple requests with the same executor id and run within a short timespan of each other should be treated as if only the last query returned results.
I ended up finding the code that does this, I'm pretty sure it is https://github.com/Ironholds/rainbow/blob/master/data_retrieval/core.py
I've got a patch worked up that should do the trick, but havn't fully tested yet.
I consider that it should work this way:
- User runs query A and gets 0 results and a search suggestion B. This is logged as a zero result query.
- User runs query B and gets results. This is not logged as a zero results query.
- User runs query A. Backend sees 0 results and search suggestion B, runs search suggestion B, and gives that to the user. This is not logged as a zero results query.
I figure this is probably the way you've implemented it, but I wanted to make sure the requirements are clear.