Title: Combining Logs
Last modified: April 5, 2023

---

# Combining Logs

 *  [321abc](https://wordpress.org/support/users/deraxia/)
 * (@deraxia)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/combining-logs/)
 * 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](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/combining-logs/#post-16631190)
 * 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 [321abc](https://wordpress.org/support/users/deraxia/)
 * (@deraxia)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/combining-logs/#post-16631425)
 * 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.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [321abc](https://wordpress.org/support/users/deraxia/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/combining-logs/#post-16631425)
 * Status: not resolved