Search API Views don't always use exposed filters for the search - they can also use contextual filters which grab the search terms from URL.
This module only works in the former case. To accommidate the latter, it should be possible to set the links to change the URL argument instead of the query string in such cases.
Incidentally, Search API Spellcheck module has a similar problem (#1425766: Spelling suggestions not display in View). The module logic is very different (using views handlers) but some of the issues apply to both cases. A key difference will be, that fix for that module will probably require sniffing the type of view automatically while this will probably require a manual setting per current search block.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | current_search_links-new_search_terms_fix-1754446-5.patch | 887 bytes | chirhotec |
| #2 | current_search_links_contextual_filters.patch | 2.48 KB | alanom |
| #1 | current_search_links_contextual_filters.patch | 2.4 KB | alanom |
Comments
Comment #1
alanom commentedHere's a patch. It:
Comment #2
alanom commentedsmall correction, added default value
Comment #3
Johnny vd Laar commentedThank you, I'll look into the patch and submit a new version hopefully in the coming weeks
Comment #4
Johnny vd Laar commentedI've added a slightly modified version of your patch:
https://drupal.org/commitlog/commit/33676/fda2ee67346adc20bb5e8746758e11...
Thanks for the help. Can you check whether it works?
Comment #5
chirhotec commented@Johnny,
You removed the $new_search_terms, in favor or explicitly setting $args[$arg_position] = implode(' ', $keys_copy). However, you didn't update $params['search_api_views_fulltext'] = $new_search_terms;. This generates an error for searches that are using the original exposed filters.
Here's a patch that undoes that change.
I have not tested whether contextual filters are actually working with your update.
Comment #6
Johnny vd Laar commentedThank you a lot. I've committed your fix.
Comment #8
alanom commentedYup, works. Had to re-enter the config form data after updating, but after doing so, it works.