You are here

Views Finder

Submitted by Kate on March 2, 2011 - 7:04pm

We are actually asked about custom searches fairly often. Most of the time we can do something simple to accommodate the needs of a client, but this instance was a bit different.

New York Communities for Change requested a mini-site that would allow users to search for their school to see if it had been tested for a particular contaminant called PCB. Not being familiar with the different names of New York schools, we thought this would be another extremely simple search.

We used the Drupal module called Finder, which can search through views or pages for terms. Using CCK, we created a "school" content type and added a field for synonyms that users might search. For instance, if a school had the name "I.S. 141 The Steinway," we would add synonyms for "IS 141," "I.S. 141," and "The Steinway." However, if someone typed in "Steinway," they were shown a no results page. Also, if they typed in "PS" they were just taken to the first result rather than shown a list of possible results.

We wanted to make this as easy as possible, especially for people who are not necessarily computer pros, and this was not the way it was supposed to work. After a bit of searching, we found this issue posting on Drupal.org that pointed us in the right direction. Under the Advanced settings for our Finder, we changed the Multiple Element Result Combination from "Conjunction" to "Disjunction." We also edited our Finder Element's Submitted Values settings: Disjunction, Disjunction, Recommended, and Contains.

Because we were using a views finder rather than a node finder, we had to be sure to make our CCK fields output as links to the node. We did that by editing the view associated with our Finder.

Here are some links you might find useful for working with Finder