Feature #157
Generator: Advanced Search Partial
| Status: | Ready for Test | Start: | 02/03/2009 | ||
| Priority: | Normal | Due date: | |||
| Assigned to: | % 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
- 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 McClain Looney 539 days ago
- % 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.