Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | store_result_count-2140099-1.patch | 2.83 KB | lex0r |
Comments
Comment #1
lex0r CreditAttribution: lex0r commentedPatch attached. Also, a fix applied to hook_schema to ensure language will be present on fresh installations (sorry, no separate issue :).
Comment #2
lex0r CreditAttribution: lex0r commentedComment #3
maczkojanos CreditAttribution: maczkojanos commentedHi,
maybe you adapt this patch to the search_api_db ?
thanks
Comment #4
helmo CreditAttribution: helmo commentedThe 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.