Class: Couchbase::Cluster::SearchQuery::ConjunctionQuery
Overview
Result documents must satisfy all of the child queries.
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(*queries) {|self| ... } ⇒ ConjunctionQuery
Returns a new instance of ConjunctionQuery.
[View source]
680
681
682
683
684
|
# File 'lib/couchbase/search_options.rb', line 680
def initialize(*queries)
super()
@queries = queries.flatten
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
675
676
677
|
# File 'lib/couchbase/search_options.rb', line 675
def boost
@boost
end
|
Instance Method Details
#and_also(*queries) ⇒ Object
[View source]
687
688
689
|
# File 'lib/couchbase/search_options.rb', line 687
def and_also(*queries)
@queries |= queries.flatten
end
|
#empty? ⇒ Boolean
[View source]
691
692
693
|
# File 'lib/couchbase/search_options.rb', line 691
def empty?
@queries.empty?
end
|
#to_h ⇒ Hash<Symbol, #to_json>
[View source]
696
697
698
699
700
701
702
|
# File 'lib/couchbase/search_options.rb', line 696
def to_h
raise ArgumentError, "compound conjunction query must have sub-queries" if @queries.nil? || @queries.empty?
data = {:conjuncts => @queries.uniq.map(&:to_h)}
data[:boost] = boost if boost
data
end
|