Created
November 10, 2010 20:24
-
-
Save lbjay/671451 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_dependency 'vendor/plugins/blacklight/app/controllers/catalog_controller.rb' | |
class CatalogController < ApplicationController | |
def solr_search_params(extra_controller_params={}) | |
solr_parameters = super extra_controller_params | |
if solr_parameters.key? :q | |
solr_parameters[:q] = solr_parameters[:q].gsub(/\S+/) { |match| | |
if match.include? ':' or match.index('=') != 0 | |
match | |
else | |
match.sub("=", "#{Blacklight.config[:nosyn_field]}:") | |
end | |
} | |
end | |
return solr_parameters | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment