The core Drupal Search module logs each search request to Watchdog if the "Log searches" configuration option is set on the "Search settings" admin page. When using the Search API module and Search API pages, though, this doesn't happen. This results in an empty "Top search phrases" report (and, for me at least, a client asking why the report is empty!).

It seems like this module should respect the "Log searches" configuration option. Patch to follow.

Comments

jrb created an issue. See original summary.

jrb’s picture

With the attached patch, search queries using the Search API pages module will be logged to the Watchdog in the same way that the core Drupal Search module does (if the variable "search_logging" is set).

jrb’s picture

Status: Active » Needs review
jrb’s picture

So, I just double-checked and saw that core Search *is not* a dependency for Search API (I was thinking it was). That means that the "Top search phrases" report which is part of the Database logging (dblog) module wouldn't exist unless the Search module is also enabled. Oops!

That report may be useful, so does it make sense to add a hook_menu_alter() to this module add that report? We'd also need to add that "Log searches" setting (or equivalent) to this module.

borisson_’s picture

That report may be useful indeed, but I think this should probably be a feature in search api rather than search api pages. For the 7.x version of this module, we're not introducing new code for anything but bugfixes.

drunken monkey’s picture

Category: Feature request » Support request
Status: Needs review » Fixed

Please just use the Search API stats module for this.
Since this functionality impacts performance, and is unnecessary for a lot of sites, having it in an add-on module makes more sense than including it here or in Search API directly.

jrb’s picture

Thanks! Didn't know that module existed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.