Class: Couchbase::Cluster::SearchQuery::MatchPhraseQuery
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
boolean_field, booleans, conjuncts, date_range, disjuncts, doc_id, geo_bounding_box, geo_distance, geo_polygon, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, #to_json, wildcard
Constructor Details
#initialize(match_phrase) {|self| ... } ⇒ MatchPhraseQuery
Returns a new instance of MatchPhraseQuery.
[View source]
103
104
105
106
107
|
# File 'lib/couchbase/search_options.rb', line 103
def initialize(match_phrase)
super()
@match_phrase = match_phrase
yield self if block_given?
end
|
Instance Attribute Details
#analyzer ⇒ String
98
99
100
|
# File 'lib/couchbase/search_options.rb', line 98
def analyzer
@analyzer
end
|
#boost ⇒ Float
92
93
94
|
# File 'lib/couchbase/search_options.rb', line 92
def boost
@boost
end
|
#field ⇒ String
95
96
97
|
# File 'lib/couchbase/search_options.rb', line 95
def field
@field
end
|
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
[View source]
110
111
112
113
114
115
116
117
|
# File 'lib/couchbase/search_options.rb', line 110
def to_h
data = {:match_phrase => @match_phrase}
data[:boost] = boost if boost
data[:operator] = operator.to_s if operator
data[:field] = field if field
data[:analyzer] = analyzer if analyzer
data
end
|