• Since installing Relevanssi live ajax, my search logs have a lot of very similar searches missing a few letters. For example, there will be searches logged for:

    • employ
    • employm
    • employmen
    • employment

    I’m wondering if there’s a way to combine these so they all appear as one search for the main word “employment” in the logs. I’d prefer to avoid disabling search logging for ajax search since it is useful in its own right.

    Thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I’m aware of this issue (which also annoys me), but the problem here is that Relevanssi has no way to tell which search is the last one. It would be nice to be able only to log the final search, but the decision to log or not must be done before it’s possible to tell whether the user continues or not.

    I’ve been thinking about possible solutions for this, but I haven’t come up with anything clever yet. I suppose it’s possible to scan the logs afterwards and remove these partial duplicates if they’re close together, but I haven’t bothered to figure out a method to do that.

    I asked ChatGPT about suggestions on how to do this. It didn’t quite capture the idea and didn’t come up with anything useful, but as usual, asking someone for help made me figure out a solution. I should probably add some kind of a session ID to the searches that would bind the searches from one searcher together – a hash from the page URL and user IP address, for example – and then you could clean up the logs and only keep the longest term from each session.

    Thread Starter d3d5x1

    (@deraxia)

    Thanks for the reply! I hope you can manage to figure it out some day. Relevanssi is the best search plugin WP has ever had and the ajax addition is great. Getting this figured out would make them even better.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Combining Logs’ is closed to new replies.