Possible to not log partial matches done via AJAX?
The logging is pretty unusable if you're doing a "live" search via AJAX. Since the logs from Low Search operate thinking that each term will be a new search, when you implement a "live search" feature, it puts every partial word into the search log. Searching for "appointment" will bring up every phrase that builds to that point, so "appo", "appoi", "appoin", "appoint", etc will all be logged showing up.
Basically, there isn't a clear way to figure out when a search is complete or if the user found what they were looking for.
This scenario fills up the log fast because it uses up a ton of entries for each partial word. I raised the limit in this particular instance to 20,000 entries, but it just means that it'll be a larger list of partial words to pick through.
Is there any approach that logs the search terms that are most likely deemed as "successful"?
Replies
Low 24 Mar 2014 18:00
Well, let me turn it around... Can you determine from the front end which term is the actual term you want to search for and log? I reckon that's pretty hard to do. So the same is true for logging the search terms.
I think it might be good to try and "throttle" the input, ie. not fire it onkeyup/onkeydown. Instead, fire a counter onkeyup/onkeydown which gets cancelled if another key is pressed within x milliseconds. That way you only fire the function (and log the search) if the user pauses typing.
john.e.peacock 24 Mar 2014 18:24
I suppose another approach would be to turn off logging entirely and setup an click/selected event listener on the resulting terms after being added to the DOM. If a click on the resulting list happens, then grab the words in the input field and send off a Google Analytics event.
Low 25 Mar 2014 07:21
If Low Search had an endpoint to call to log a search (like calling site.com?ACT=x&query=y), then that would defer all responsibility to the front-end, and you could use it as you would see fit. Would something like that work for you?