The hook used to save search parameters doesn't provide details about actual results because it is run before search is run. The way we can fix it is to save statistics after actual search was run and results are available. Unfortunately I couldn't find a hook in search_api specially provided for that purpose, but there is one in search_api_solr: hook_search_api_solr_search_results()

I propose to update numfound using the above mentioned hook. If Solr is not installed nothing will happen, but if it is one will see number of found items.

CommentFileSizeAuthor
#2 store_result_count-2140099-1.patch2.83 KBlex0r
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lex0r’s picture

Patch attached. Also, a fix applied to hook_schema to ensure language will be present on fresh installations (sorry, no separate issue :).

lex0r’s picture

maczkojanos’s picture

Hi,

maybe you adapt this patch to the search_api_db ?

thanks

helmo’s picture

Status: Active » Needs review

The patch from #2contained some unrelated changes, partly from #2191997: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'language' in 'field list'

Here's a re-roll. It works as expected.