Class: Couchbase::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]
740
741
742
743
744
|
# File 'lib/couchbase/search_options.rb', line 740
def initialize(*queries)
super()
@queries = queries.flatten
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
735
736
737
|
# File 'lib/couchbase/search_options.rb', line 735
def boost
@boost
end
|
Instance Method Details
#and_also(*queries) ⇒ Object
[View source]
747
748
749
|
# File 'lib/couchbase/search_options.rb', line 747
def and_also(*queries)
@queries |= queries.flatten
end
|
#empty? ⇒ Boolean
[View source]
751
752
753
|
# File 'lib/couchbase/search_options.rb', line 751
def empty?
@queries.empty?
end
|
#to_h ⇒ Hash<Symbol, #to_json>
[View source]
756
757
758
759
760
761
762
|
# File 'lib/couchbase/search_options.rb', line 756
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
|