[Drupal] How to get more advanced search forms in drupal 7?
Getting search fields inside a view is easy that is adding a field in 'Filter :Criteria' and exposing it, so we get the search field and now you can search based on that field.And when we require more than one field to be searched we need to include it by adding the fields in 'Filter Criteria' and exposing it , which looks weird when we have 3 fields in a single search form.So what if we have an option to make it a single field say we have to search the contents based on 3 fields with a single search field.Isn't that interesting?Here comes the use of 'Finder' module which is safe and sound.Now let's have a look at it.One of the major advantage is that we can get the autocomplete dropdown while searching.
Step 1 : Enable the module as usual in Admin > Modules.
Step 2 : Go to admin/structure/finder .
Step 3 : Here we can see an option to add the Finder.
Step 4 : While adding a finder there is an option to give the view name.Select the view where our contents are present.
Step 5 : Next we will get a form were we need to cook a bit.
Step 6 : Initially in the form we need to add an element.Here the form element means this search is now available in a form.So we need to give the Title on the form element.
Step 7 : Select an Element from the select list.From the select list, select 'Autocomplete textfield' if we need to show the dropdown while entering the search field.
Step 8 : After adding the element we can see a collapsible field named Settings , here is the place to add the fields, that is the fields we need to search for.Add the fields .
Step 9 : This module also provides us the options for AJAX and whether to get this search form in a block or a page etc.
Step 10 : Provide path for the page and this is possible in Basic settings.
Step 11 : Visit the page and search for the field.(On searching we can get the results in a dropdown list and we can select from the dropdown.)
With the above steps you can see that your search works perfectly !!
References:
1. http://drupal.org/project/Finder