Feature #157

avatar

Generator: Advanced Search Partial

Added by Matt Zumwalt 541 days ago. Updated 528 days ago.

Status:Ready for Test Start:02/03/2009
Priority:Normal Due date:
Assigned to:avatarMcClain Looney % Done:

80%

Category:Search/Solr Spent time: 4.75 hours
Target version:-
Sponsor:


Description

Provide a rails generator that creates view partial for "Advanced Search" form. Iterates through all of an ActiveFedora Model's fields, creating a corresponding search input for each.

Title: {text input box here}
Keywords: {text input box here}

... etc.

this in turn submits to a controller that calls find_by_solr

find_by_solr in turn translates the search query into a solr-formatted query and passes it to solr.

History

Updated by Matt Zumwalt 541 days ago

avatar
  • Assigned to set to Matt Zumwalt

trackback: #137

McClain Points out:
It appears things work sort of as we would expect. The users just have to have intimate knowledge of the solr schema and search syntax (it's just that easy!).

For instance:
Searching for an OH with the abstract set to "foo" looks like this: "abstract_text:foo", since the abstract field is defined as "text" in the metadata declaration in OH.

The user obviously has to know the object model intimately to do this, which is not a reasonable expectation (hell, I can barely find stuff, and I have access to the code!).

For reference, you can get a listing of the fields available in a solr instance via the schema browser:
http://jwa2.mediashelf.us:8080/solr/admin/schema.jsp

Documentation for Solr query syntax:

Solr Query Syntax Docs
... which assumes you've read the Lucene Query Parser Syntax Docs

Updated by Matt Zumwalt 539 days ago

avatar
  • Assigned to changed from Matt Zumwalt to McClain Looney

Updated by McClain Looney 539 days ago

avatar
  • % Done changed from 0 to 80

First cut is in.

To use:

install the af_fedora_generator gem

script/generate af_solr some_active_fedora_base

This will create some files, and give you some instructions. it will generate a form, a results view, and a controller.

play around with it, give me suggestions.

it was tested against salt. shortcomings include not having the ability to see predefined fields, such as in QDCDS streams (though there is an obvious workaround), & hideous result view (though it was meant to be modified).

with some tweaking, this should demo well.

Updated by McClain Looney 539 days ago

avatar
  • Status changed from New to Feedback Provided

Updated by McClain Looney 532 days ago

avatar
  • Status changed from Feedback Provided to Assigned

Updated by McClain Looney 528 days ago

avatar
  • Status changed from Assigned to Ready for Test

Also available in: Atom PDF