Class: Couchbase::SearchQuery::TermQuery
Overview
A query that looks for exact matches of the term in the index (no analyzer, no stemming). Useful to check what the actual content of the index is. It can also apply fuzziness on the term. Usual better alternative is ‘MatchQuery`.
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(term) {|self| ... } ⇒ TermQuery
Returns a new instance of TermQuery.
[View source]
903
904
905
906
907
|
# File 'lib/couchbase/search_options.rb', line 903
def initialize(term)
super()
@term = term
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
889
890
891
|
# File 'lib/couchbase/search_options.rb', line 889
def boost
@boost
end
|
#field ⇒ String
892
893
894
|
# File 'lib/couchbase/search_options.rb', line 892
def field
@field
end
|
#fuzziness ⇒ Integer
895
896
897
|
# File 'lib/couchbase/search_options.rb', line 895
def fuzziness
@fuzziness
end
|
#prefix_length ⇒ Integer
898
899
900
|
# File 'lib/couchbase/search_options.rb', line 898
def prefix_length
@prefix_length
end
|
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
[View source]
910
911
912
913
914
915
916
917
918
919
|
# File 'lib/couchbase/search_options.rb', line 910
def to_h
data = {:term => @term}
data[:boost] = boost if boost
data[:field] = field if field
if fuzziness
data[:fuzziness] = fuzziness
data[:prefix_length] = prefix_length if prefix_length
end
data
end
|