The searchMultiple() method doesn't pass the $fq argument through to $this->getFacetParams() which means that the certain facet queries aren't being altered and passed back as they are in the equivalent search() method, which caused for me at least the Facet I created via the Search API Multi Facetapi sandbox module (that allows facets against Search API multi indexes) to completely break.

I spent a ridiculously long time tracking this issue down, so I hope someone else benefits from this extremely simple fix (patch coming in comment #1)

Comments

deciphered’s picture

Status: Active » Needs review
StatusFileSize
new503 bytes

Patch attached (super tiny fix).

krisweinhold’s picture

Thanks for this! There's actually a ton of stuff missing in the searchMultiple() method that has been in the single-index-search method for awhile.

Namely, working search excerpts with highlighting, as well as, properly handled facets. I've been working on using the Search API Multi Facetapi sandbox module as well, and this patch fixes a ton of issues surrounding highlighting/facets on multi-index searches.

Also, if you need to facet on date fields, be sure to pickup this patch too: #1930184: Fix for Date Facets in Multi-Index Search

drunken monkey’s picture

Title: searchMultiple not passing $fq to getFacetParams, breaks Search API Multi Facetapi » Fix facet handling for multi-index searches
Status: Needs review » Fixed

@ Deciphered: Sorry it took me so long to see this. Thanks for the patch, looks good!
Committed.

@ krisweinhold: Please create a new issue for your patch. It also needs some work: remove the $spell_inserted stuff (that's would be another separate issue), fix your whitespace (no tabs or trailing whitespace), and please only port code from the normal search method to the multi-index one, without introducing new stuff.
It would also be great if you could base your patch on the one in #1846254-6: Remove the SolrPhpClient dependency – I hope very much that one will be committed soon, and this would save us the re-basing/re-rolling.

Status: Fixed » Closed (fixed)

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