Browse files

Fixing typos and removing obsolete info.

  • Loading branch information...
1 parent 0f0172e commit 14683caeaa4c483b4dabc53664b820dcf76eb530 @cbeer cbeer committed Jan 31, 2012
Showing with 21 additions and 16 deletions.
  1. +21 −16 README.rdoc
@@ -12,9 +12,11 @@ This is an advanced search plugin for Blacklight ( http://www.projectblacklight.
=== Blacklight 3.x/Rails 3
Add to your application's Gemfile:
gem "blacklight_advanced_search"
then run 'bundle install'. Then run:
rails generate blacklight_advanced_search
* The 'generate' command will install the plugin's assets into your application's application.js/application.css asset pipeline files
@@ -34,10 +36,7 @@ You can also send the advanced search form url parameters representing a search,
url_for( params.merge(:controller => "advanced", :action => "index")
-If you do not have the default :controller/:action route enabled for your application, you may need to add a custom route to config/routes.rb. For example:
- map.advanced 'advanced', :controller => 'advanced', :action => 'index'
By default there won't be any links in your application to the search form. If you've heavily customized your app, you can put them wherever you want as above.
However, especially if your app isn't much customized, the optional installer can write a localized Blacklight search form into your application with a 'more options' link to advanced. You may need to adjust your styles to make room for the new link, depending on what you've done with your app.
@@ -65,27 +64,33 @@ Due to limitations of the logic, sometimes these generated Solr queries may not
Your main blacklight search fields are generally defined in config/blacklight_config.rb, under "config[:search_fields]" ( ). If there are particular search fields in your main blacklight config you want excluded from the advanced search form, you can set ":include_in_advanced_search => false"
All advanced search fields must share the same Solr request handler (":qt"). As such, search fields that use a custom ":qt" parameter may not be re-used by the advanced search plugin. However, you may use a separate Solr request handler than the Blacklight default. If you would like the advanced search to use a different Solr request handler than your app's default, set:
- blacklight_config.advanced_search.qt
+ blacklight_config.advanced_search.qt
to the name of the Solr request handler.
If you use a separate Solr request handler for advanced search, you must supply a completely separate list of search fields for the advanced search form. Each field is defined by a hash whose format is specified in Blacklight::SearchFields ( ).
- blacklight_config.add_search_field('title') do |field|
- field.solr_local_parameters => {
- :qf => "title_t subtitle_t addl_titles_t title_unstem_search^1000" # see ( )
- :pf => "title_t subtitle_t addl_titles_t title_unstem_search^1000" # see ( )
- }
+ configure_blacklight do |config|
+ config.add_search_field('title') do |field|
+ field.solr_local_parameters = {
+ :qf => "title_t subtitle_t addl_titles_t title_unstem_search^1000" # see ( )
+ :pf => "title_t subtitle_t addl_titles_t title_unstem_search^1000" # see ( )
+ }
+ end
Additionally, to make your advanced search solr requests more concise, you are strongly encouraged to take advantage of the :local_solr_parameters option in your search field definition to use a solr parameter substitution with $variables.
- blacklight_config.add_search_field('authot') do |field|
- field.solr_local_parameters => {
- :qf=>"$qf_author",
- :pf=>"$pf_author"
- }
+ configure_blacklight do |config|
+ config.add_search_field('author') do |field|
+ field.solr_local_parameters = {
+ :qf=>"$qf_author",
+ :pf=>"$pf_author"
+ }
+ end
Within your solrconfig.xml you may then provide the appropriate custom configuration.
@@ -148,7 +153,7 @@ You may also find the rspecs for parsing a user-entered query and converting it
== Running tests
Test coverage is provided with rspec, run all tests by running:
- spec ./spec
+ rspec
== To Do

0 comments on commit 14683ca

Please sign in to comment.