New Drupal Module: Views Search
A feature request for one of my recent projects was an "Advanced Search" functionality, similar to the ones that is commonly found in social networking and personal sites. Rather than creating a completely custom search form using Drupal's Forms API, I decided to create a module called "Views Search" which uses the Views module and allows anyone to create advanced searches for anything Views can process without custom coding.
Views' exposed filter work very similar to the search functionality, however exposed filters in the Views module work like true filters, where a list of nodes is limited down to the intended results using a combination of several filters. In contrast to this approach, a more traditional search form allows users to define all criteria first (before seeing any results) and then click on a "Search" button to see the results. This module allows site administrators to easily use the behavior of a traditional search for selected views.
In addition, the Views Search module allows Drupal site members to save their searches for future usage.
Here's an overview of the feature set:
- Separates the search form and results: selected views show a search form without showing the results on the first page and the search results without showing the search form/filters on the following pages
- Allows users to start over with a search (using a button on search results page)
- Allows users to modify the search criteria (using a button on the search results page that expands search criteria using jQuery)
- Allows users to save a set of search criteria for later usage
- Allows users to modify/overwrite the name and search criteria for a saved search
- Provides a default view that allows the current user to manage saved searches
- Provides a block showing a drop-down with saved searches for the current user
- Enables site administrators to select views that should act like "search views"
- Enables site administrators to limit the number of saved searches for certain user roles & set saved search limits per rule
- Enables site administrators to batch-delete all saved searches for a specific view
You can download the module from the Views Search Module page on Drupal.org. I'm looking forward to any feedback.
Comments
Hi
I really like the views modules because I need to implement something similar on a website I am making for a new firm. It is going to about travelers who might want to rent hostels.
So I want them to be able to search according to their preferences. What I dont understand is how to implement a search block which could search within a range e.g. the users selects a min. and max price and gets a results according to it. I see here that in the screenshot you have allowed for search according to min and max age. Can you help me with this?
Thanks!
- Login to post comments
Sorry for replying terribly late.
Thanks for your help. However, when I do as you said above it simply displays a text field rather than a drop down list, which is because the price field in that content is simply a text box (added using Money CCK) and not a select list. Is there any way I can rewrite the view filter as a select list like you have on real state websites.
Really appreciate your help!
- Login to post comments
Hi,
I really like this module but i want to ask something whether this module is similar to that of search module and does this module can be implemented without views module?
- Login to post comments
Hi,
I stumbled here from Views Search project page. I'm in the process of building a Drupal-based social network and I was just looking around for some way to make searching people (a View) a bit more user-friendly, when I found your module.
I like very much how you arranged the search form in the screenshots you posted; since I'm going to build something exactly like that, I'd like to know what site they come from, so I can take a look at it "live" (and get some inspiration from your excellent work :D).
Thank you very much for your help (and the very useful module!).
- Login to post comments
Hello Danny
Please i would like you to help me out.i want to setup a website with search fir cck fields example search for lawyers and search for law firms,under search for lawyers u will have search options like first name,last name country and then u click on search buttom and then the search result will give u what u chose for ur fields in views.Please i will be very very happy.Thanks very much and hope to hear from you soon as possible.
- Login to post comments
























