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, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, wildcard
Constructor Details
#initialize(*queries) {|self| ... } ⇒ ConjunctionQuery
Returns a new instance of ConjunctionQuery.
[View source]
618
619
620
621
622
|
# File 'lib/couchbase/search_options.rb', line 618
def initialize(*queries)
super()
@queries = queries.flatten
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
613
614
615
|
# File 'lib/couchbase/search_options.rb', line 613
def boost
@boost
end
|
Instance Method Details
#and_also(*queries) ⇒ Object
[View source]
625
626
627
|
# File 'lib/couchbase/search_options.rb', line 625
def and_also(*queries)
@queries |= queries.flatten
end
|
#empty? ⇒ Boolean
[View source]
629
630
631
|
# File 'lib/couchbase/search_options.rb', line 629
def empty?
@queries.empty?
end
|
#to_json(*args) ⇒ String
[View source]
634
635
636
637
638
639
|
# File 'lib/couchbase/search_options.rb', line 634
def to_json(*args)
raise ArgumentError, "compound conjunction query must have sub-queries" if @queries.nil? || @queries.empty?
data = {"conjuncts" => @queries.uniq}
data["boost"] = boost if boost
data.to_json(*args)
end
|