Module: BlacklightCql::SearchBuilderExtension

Extended by:
ActiveSupport::Concern
Defined in:
lib/blacklight_cql/search_builder_extension.rb

Overview

Mix-in to a SearchBuilder

> Adds logic for handling CQL queries, and adds it to the default_processor_chain

If you are still using CatalogController#search_params_logic, you will need to add :cql_to_solr_search_params to it.

Instance Method Summary collapse

Instance Method Details

#cql_to_solr_search_params(solr_params) ⇒ Object

Over-ride solr_search_params to do special CQL-to-complex-solr-query processing iff the “search_field” is our pseudo-search-field indicating a CQL query.



27
28
29
30
31
32
33
34
35
# File 'lib/blacklight_cql/search_builder_extension.rb', line 27

def cql_to_solr_search_params(solr_params)

  if blacklight_params["search_field"] == self.pseudo_search_field[:key] && ! blacklight_params["q"].blank?
    parser = CqlRuby::CqlParser.new

    solr_params[:q] = "{!lucene} " + parser.parse( blacklight_params["q"] ).to_bl_solr(self.blacklight_config)     
  end
  return solr_params
end