Class: Couchbase::SearchQuery::MatchPhraseQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::MatchPhraseQuery
- Defined in:
- lib/couchbase/search_options.rb
Overview
The input text is analyzed and a phrase query is built with the terms resulting from the analysis.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(match_phrase) {|self| ... } ⇒ MatchPhraseQuery
constructor
A new instance of MatchPhraseQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Constructor Details
#initialize(match_phrase) {|self| ... } ⇒ MatchPhraseQuery
Returns a new instance of MatchPhraseQuery.
166 167 168 169 170 |
# File 'lib/couchbase/search_options.rb', line 166 def initialize(match_phrase) super() @match_phrase = match_phrase yield self if block_given? end |
Instance Attribute Details
#analyzer ⇒ String
161 162 163 |
# File 'lib/couchbase/search_options.rb', line 161 def analyzer @analyzer end |
#boost ⇒ Float
155 156 157 |
# File 'lib/couchbase/search_options.rb', line 155 def boost @boost end |
#field ⇒ String
158 159 160 |
# File 'lib/couchbase/search_options.rb', line 158 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
173 174 175 176 177 178 179 |
# File 'lib/couchbase/search_options.rb', line 173 def to_h data = {:match_phrase => @match_phrase} data[:boost] = boost if boost data[:field] = field if field data[:analyzer] = analyzer if analyzer data end |