[support] Canned Search

Steve Edwards killshot91 at comcast.net
Mon Aug 31 22:24:23 UTC 2009


I've been tasked with creating a search feature for a large site that 
utilizes Apache Solr, and I'm looking for some ideas on how to construct 
it.  If I end up writing some custom code, it will definitely be 
contributed back to the community.

The idea is to created a canned search, where an editor can create a 
search with predefined criteria and save it. and then when the user 
navigates to a certain page defined by the search, the results from this 
search are displayed.  So, for instance, if I have a node type of Event 
that contains a date field for the event, an editor could create a 
predefined search for all events that fall on a certain date, and when a 
user navigates to that page (or another predefined page), the search 
results are displayed.

Our initial thought had been to have a content type called 
canned_search, and and editor would create one with the predefined 
fields and their criteria.  We would then hook into the submit function 
for that content type and get the data from Solr.  On display, we would 
modify the content type to show the search results instead of the search 
criteria.  However, I can't help but think that there would be a better 
way to do this.  Either way, the trickiest issue is allowing the editor 
to specify which fields to include in the search, and then what values 
he can enter for each field.  I'm envisioning some sort of AJAXy thing 
where the editor picks from a list of possible categories, and then a 
field next to it would be used to enter the criteria itself.  There 
would be a More button that the user could click on to add another 
criteria field, and he could keep doing that as many times as is needed.

So I'm looking for suggestions on how to implement this.  Does anybody 
know of any modules that might do this part way?  I'd be willing to add 
to already existing modules, too.

Thanks.

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090831/d15beded/attachment.htm>


More information about the support mailing list