Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Jul 2016 at 07:59 UTC
Updated:
15 Mar 2017 at 12:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
plazik commentedComment #3
drunken monkeyAwesome idea, thanks a lot for suggesting this!
I made a few alterations to your patch, please see the attached version. (Specifically, I'm applying a fix from D8 to the
__toString()method that prevents mayhem when the query options contain objects.) Please test/review and see if this still works for you!Also, while not really part of this issue, we might (like in D8) also add a reference to the view to the query in the
search_api_viewoption. But, as said, not really part of this issue, so we can also commit this just as-is. (That's what caused the problems that needed the mentioned fix in D8, btw.)Finally, this will give us the query at the time it was built in Views – is this what we want here? Afterwards, there's still processors and hooks that could modify the query, do we want to show that version instead? (Then we'd have to put that line after the query is executed in
execute().)Probably it's fine like this, though. Still, would be interested in your thoughts on that.
Comment #4
plazik commentedI've tested your path, it works fine for me.
Yes, like in Views core http://cgit.drupalcode.org/views/tree/plugins/views_plugin_query_default...
Comment #6
drunken monkeyOK, great. Committed.
Thanks again!
Moving to D8 for porting.
Comment #7
drunken monkeyComment #9
drunken monkeyComment #11
idebr commentedIt may be worth noting that not every query can be cast to a string. I recently updated Search API to 7.x-1.21, but without this commit in search_api_multi searching results in a recoverable fatal error: Recoverable fatal error: Object of class SearchApiMultiQuery could not be converted to string in build()