Class: Solr::Query::Request
- Inherits:
-
Object
- Object
- Solr::Query::Request
- Defined in:
- lib/solr/query/request.rb,
lib/solr/query/request/facet.rb,
lib/solr/query/request/filter.rb,
lib/solr/query/request/sorting.rb,
lib/solr/query/request/boosting.rb,
lib/solr/query/request/grouping.rb,
lib/solr/query/request/or_filter.rb,
lib/solr/query/request/and_filter.rb,
lib/solr/query/request/field_list.rb,
lib/solr/query/request/geo_filter.rb,
lib/solr/query/request/spellcheck.rb,
lib/solr/query/request/sorting/field.rb,
lib/solr/query/request/boost_magnitude.rb,
lib/solr/query/request/edismax_adapter.rb,
lib/solr/query/request/field_with_boost.rb,
lib/solr/query/request/sorting/function.rb,
lib/solr/query/request/shards_preference.rb,
lib/solr/query/request/boosting/geodist_function.rb,
lib/solr/query/request/boosting/ln_function_boost.rb,
lib/solr/query/request/shards_preferences/property.rb,
lib/solr/query/request/boosting/scale_function_boost.rb,
lib/solr/query/request/boosting/exists_boost_function.rb,
lib/solr/query/request/boosting/phrase_proximity_boost.rb,
lib/solr/query/request/boosting/dictionary_boost_function.rb,
lib/solr/query/request/boosting/ranking_field_boost_function.rb,
lib/solr/query/request/boosting/field_value_match_boost_function.rb,
lib/solr/query/request/boosting/recent_field_value_boost_function.rb,
lib/solr/query/request/boosting/field_value_less_than_boost_function.rb,
lib/solr/query/request/boosting/numeric_field_value_match_boost_function.rb,
lib/solr/query/request/boosting/textual_field_value_match_boost_function.rb
Defined Under Namespace
Modules: BoostMagnitude Classes: AndFilter, Boosting, EdismaxAdapter, Facet, FieldList, FieldWithBoost, Filter, GeoFilter, Grouping, OrFilter, ShardsPreference, ShardsPreferences, Sorting, Spellcheck
Instance Attribute Summary collapse
-
#boosting ⇒ Object
Returns the value of attribute boosting.
-
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
-
#facets ⇒ Object
Returns the value of attribute facets.
-
#field_list ⇒ Object
Returns the value of attribute field_list.
-
#filters ⇒ Object
Returns the value of attribute filters.
- #grouping ⇒ Object
-
#limit_docs_by_field ⇒ Object
Returns the value of attribute limit_docs_by_field.
-
#phrase_slop ⇒ Object
Returns the value of attribute phrase_slop.
-
#query_fields ⇒ Object
Returns the value of attribute query_fields.
-
#query_operator ⇒ Object
Returns the value of attribute query_operator.
-
#search_term ⇒ Object
readonly
Returns the value of attribute search_term.
- #shards_preference ⇒ Object
- #sorting ⇒ Object
-
#spellcheck ⇒ Object
Returns the value of attribute spellcheck.
Instance Method Summary collapse
-
#initialize(search_term:, query_fields: [], field_list: Solr::Query::Request::FieldList.new, filters: []) ⇒ Request
constructor
A new instance of Request.
- #run(page: nil, start: nil, rows: nil, page_size: nil, runner_options: {}) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(search_term:, query_fields: [], field_list: Solr::Query::Request::FieldList.new, filters: []) ⇒ Request
Returns a new instance of Request.
27 28 29 30 31 32 |
# File 'lib/solr/query/request.rb', line 27 def initialize(search_term:, query_fields: [], field_list: Solr::Query::Request::FieldList.new, filters: []) @search_term = search_term @query_fields = query_fields @field_list = field_list @filters = filters end |
Instance Attribute Details
#boosting ⇒ Object
Returns the value of attribute boosting.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def boosting @boosting end |
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def debug_mode @debug_mode end |
#facets ⇒ Object
Returns the value of attribute facets.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def facets @facets end |
#field_list ⇒ Object
Returns the value of attribute field_list.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def field_list @field_list end |
#filters ⇒ Object
Returns the value of attribute filters.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def filters @filters end |
#grouping ⇒ Object
41 42 43 |
# File 'lib/solr/query/request.rb', line 41 def grouping @grouping ||= Solr::Query::Request::Grouping.none end |
#limit_docs_by_field ⇒ Object
Returns the value of attribute limit_docs_by_field.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def limit_docs_by_field @limit_docs_by_field end |
#phrase_slop ⇒ Object
Returns the value of attribute phrase_slop.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def phrase_slop @phrase_slop end |
#query_fields ⇒ Object
Returns the value of attribute query_fields.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def query_fields @query_fields end |
#query_operator ⇒ Object
Returns the value of attribute query_operator.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def query_operator @query_operator end |
#search_term ⇒ Object (readonly)
Returns the value of attribute search_term.
22 23 24 |
# File 'lib/solr/query/request.rb', line 22 def search_term @search_term end |
#shards_preference ⇒ Object
49 50 51 |
# File 'lib/solr/query/request.rb', line 49 def shards_preference @shards_preference ||= Solr::Query::Request::ShardsPreference.none end |
#sorting ⇒ Object
45 46 47 |
# File 'lib/solr/query/request.rb', line 45 def sorting @sorting ||= Solr::Query::Request::Sorting.none end |
#spellcheck ⇒ Object
Returns the value of attribute spellcheck.
23 24 25 |
# File 'lib/solr/query/request.rb', line 23 def spellcheck @spellcheck end |
Instance Method Details
#run(page: nil, start: nil, rows: nil, page_size: nil, runner_options: {}) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/solr/query/request.rb', line 34 def run(page: nil, start: nil, rows: nil, page_size: nil, runner_options: {}) rows ||= page_size return run_paged(page: page, page_size: rows, runner_options: ) if page && rows return run_start(start: start, rows: rows, runner_options: ) if start && rows raise ArgumentError, 'You must specify either page/rows or start/rows arguments' end |