Class: Couchbase::SearchQuery::MatchPhraseQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::MatchPhraseQuery
- Defined in:
- lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/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.
162 163 164 165 166 |
# File 'lib/couchbase/search_options.rb', line 162 def initialize(match_phrase) super() @match_phrase = match_phrase yield self if block_given? end |
Instance Attribute Details
#analyzer ⇒ String
157 158 159 |
# File 'lib/couchbase/search_options.rb', line 157 def analyzer @analyzer end |
#boost ⇒ Float
151 152 153 |
# File 'lib/couchbase/search_options.rb', line 151 def boost @boost end |
#field ⇒ String
154 155 156 |
# File 'lib/couchbase/search_options.rb', line 154 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
169 170 171 172 173 174 175 |
# File 'lib/couchbase/search_options.rb', line 169 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 |