Closed (works as designed)
Project:
Search Autocomplete
Version:
7.x-4.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Apr 2015 at 18:14 UTC
Updated:
4 Oct 2015 at 08:54 UTC
Jump to comment: Most recent
Comments
Comment #1
dom. commentedHi !
I suppose you mean "Global: Combine fields filter" ? Just make as usual :
- create your callback view using this field and the format style "Autocompletion JSON"
- use "Expose this filter to visitors, to allow them to change it" as you would usually fo
- create your autocompletion suggestion in the module settings :
-- target whatever input field you need
-- use the view you just added as suggestion callback
Comment #2
rahullamkhade commentedHi Dominique,
Thanks for your reply. But I think you didn't got my question.
I created a separate view which is not a auto complete. It have multiple fields.
Lets say for example 2 fields.
1. Content Title field
2. Author name field
So for that I have added 'Global: Combine fields filter' for both field 1 and 2.
I linked that filter to autocomplete view 'node_autocomplete'. It works all ok for field title input.
But when I add field 2 no results are found. As 'node_autocomplete' contains only one input field as 'Input Label'.
Here is my question.
I want suggestions to field 2 (Author name field) as well. That means I have to link two views for 1 filter.
Hope you understand my issue.
Comment #3
dom. commentedYou can do it by two ways :
- you are a developer :
Build a callback method that creates the result you need with a custom DB request.
- you are not a developer :
Clone the view with the combine filter. On the cloned view, make the filter as exposed and change the output format to JSON Autocomplete. Use that cloned view instead of node-autocomplete. This is a nightmare in term of optimization, but it will work.
Comment #4
et.cetera commentedI have a similiar question. I want to combine user,node and file search in one autocomplete window, preferably divided into these sections on output showing the top3 results for each. I know how to do a simple db_query and I am familiar with views, but I have really no idea how to realize that.
Can you give me a hint on this?
Edit:
Got it! Following this comment I could modify the function search_autocomplete_autocomplete to my needs.
What you have to keep in mind is that you have to structure the matches array similiar to the json output of the view (you can inspect that by the views preview function), then this will work.
What is left is that I don't know how to implement that without modifying the module itself and that I want to search for any combinations of search patterns. I.e if I search for 'gamma ray' i want to display also the results for 'ray gamma', but I guess this is somehow not possible with this module...
Comment #5
dom. commentedHi !
Sorry I did not see your comment earlier (I did not received a notice on this !).
So congratulation to make it.
Now you can create a small custom module that will implements hook_menu() and create a custom callback method similar to what you did on search_autocomplete_autocomplete(). Then on module configuration page you can use you custom callback URL.
Could you also please share your code, that would help lots of other people !
Dom.
Comment #6
dom. commentedPlease see comment here for help.