Class: Solr::Query::Request::EdismaxAdapter

Inherits:
Object
  • Object
show all
Includes:
Support::SchemaHelper
Defined in:
lib/solr/query/request/edismax_adapter.rb

Constant Summary collapse

SOLR_INFINITY =

for cases like [100000 TO *]

'*'.freeze
EDISMAX_QUERY_FIELDS =
:qf
EDISMAX_ADDITIVE_BOOST_FUNCTION =
:bf
EDISMAX_MULTIPLICATIVE_BOOST_FUNCTION =
:boost
EDISMAX_PHRASE_BOOST =
:pf
EDISMAX_PHRASE_SLOP =
:ps
FILTER_QUERY =
:fq
FIELD_LIST =
:fl
RERANK_QUERY =
:rq
QUERY_OPERATOR =
:'q.op'
JSON_FACET =
:'json.facet'
SHARDS_PREFERENCE =
:'shards.preference'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::SchemaHelper

#solarize_field

Constructor Details

#initialize(request) ⇒ EdismaxAdapter

Returns a new instance of EdismaxAdapter.



22
23
24
# File 'lib/solr/query/request/edismax_adapter.rb', line 22

def initialize(request)
  @request = request
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



20
21
22
# File 'lib/solr/query/request/edismax_adapter.rb', line 20

def request
  @request
end

Instance Method Details

#to_hObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/solr/query/request/edismax_adapter.rb', line 26

def to_h
  solr_params = { q: request.search_term, defType: :edismax }
  solr_params = add_query_fields(solr_params)
  solr_params = add_field_list(solr_params)
  solr_params = add_filters(solr_params)
  solr_params = add_facets(solr_params)
  solr_params = add_boosting(solr_params)
  solr_params = add_grouping(solr_params)
  solr_params = add_sorting(solr_params)
  solr_params = add_debug(solr_params)
  solr_params = add_spellcheck(solr_params)
  solr_params = add_rerank_query(solr_params)
  solr_params = add_phrase_slop(solr_params)
  solr_params = add_query_operator(solr_params)
  solr_params = add_shards_preference(solr_params)
  solr_params
end