Closed (fixed)
Project:
Search API Autocomplete
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
21 Sep 2011 at 18:57 UTC
Updated:
8 Sep 2017 at 10:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI have "hack" to solve my problem, but I don't understand why.
In search_api_autocomplete.search_api_views.inc, see the // new line
(see new line, I have 1 aggregated fulltext field called search_api_aggregation_1)
If I try
$query->fields(array('search_api_views_fulltext'));it says it's not an indexed fulltext field.What I don't understand is why my aggregated & index field is not added to autocomplete's fields?
Comment #2
drunken monkeyHuh. Beats me …
For me, everything still works fine. I also don't see any way this would be influenced by the Facet API integration. This uses Views to build the query, after all, so as long as the associated view works this should also be correct. Is the relevant filter defined on the „Master“ display or only for a specific display?
Comment #3
Anonymous (not verified) commentedYes it's in the Master view, I tried both "search_api_views_fulltext" and my aggregated field. It didn't work, for some reason the field is not added to $query in
search_api_autocomplete_views_query().Maybe it is related to how I show the search textfield. I use the code from
example_form_example_search_form_alter()and attach it to a textfield (shown on the search View page, replacing the exposed form.)It used to work fine, until recently, don't know what changed.
The search id exists of course.
Comment #4
drunken monkeyHm, OK, what I could imagine is that the filter handler for the fulltext search recognizes there were no keywords input and thus does nothing, not even set the fields. However, the query should then use all fulltext fields by default, so that can't really be it, either.
Maybe try to debug
SearchApiQuery::fields()and print the call trace if the array is empty. Or …… do you mean an empty array, or NULL, or not present at all?
Comment #5
Anonymous (not verified) commentedIt seems that
SearchApiQuery::fields()is not even called and [fields:protected] exists, but is null (not an array).Comment #6
drunken monkeyAh, OK, now I see where this is coming from! As we don't call the query's
execute()method, we don't get all the automagic preprocessing there. We could just copy that in the autocomplete callback, but I think the cleaner variant is to expose the query's preprocessing and use that directly.Please try the attached patch along with the one in #1291346: Expose SearchApiQuery::preExecute() and postExecute().
Comment #7
Anonymous (not verified) commentedWow, genius. Those patches work for me.
Comment #8
drunken monkeyGreat, committed.