Class: Couchbase::Cluster::SearchQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/search_options.rb

Defined Under Namespace

Classes: BooleanFieldQuery, BooleanQuery, ConjunctionQuery, Coordinate, DateRangeQuery, DisjunctionQuery, DocIdQuery, GeoBoundingBoxQuery, GeoDistanceQuery, GeoPolygonQuery, MatchAllQuery, MatchNoneQuery, MatchPhraseQuery, MatchQuery, NumericRangeQuery, PhraseQuery, PrefixQuery, QueryStringQuery, RegexpQuery, TermQuery, TermRangeQuery, WildcardQuery

Class Method Summary collapse

Class Method Details

.boolean_field(value) {|query| ... } ⇒ BooleanFieldQuery

Prepare BooleanFieldQuery body

Parameters:

  • value (Boolean)

Yield Parameters:

Returns:



253
254
255
# File 'lib/couchbase/search_options.rb', line 253

def self.boolean_field(value)
  BooleanFieldQuery.new(value)
end

.booleans {|query| ... } ⇒ BooleanQuery

Prepare BooleanQuery body

Yield Parameters:

Returns:



751
752
753
# File 'lib/couchbase/search_options.rb', line 751

def self.booleans(&block)
  BooleanQuery.new(&block)
end

.conjuncts(*queries) {|query| ... } ⇒ ConjunctionQuery

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



659
660
661
# File 'lib/couchbase/search_options.rb', line 659

def self.conjuncts(*queries, &block)
  ConjunctionQuery.new(*queries, &block)
end

.date_range {|query| ... } ⇒ DateRangeQuery

Prepare DateRangeQuery body

Yield Parameters:

Returns:



288
289
290
# File 'lib/couchbase/search_options.rb', line 288

def self.date_range(&block)
  DateRangeQuery.new(&block)
end

.disjuncts(*queries) {|query| ... } ⇒ ConjunctionQuery

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



701
702
703
# File 'lib/couchbase/search_options.rb', line 701

def self.disjuncts(*queries, &block)
  DisjunctionQuery.new(*queries, &block)
end

.doc_id(*doc_ids) {|query| ... } ⇒ DocIdQuery

Prepare DocIdQuery body

Parameters:

  • doc_ids (String...)

Yield Parameters:

Returns:



217
218
219
# File 'lib/couchbase/search_options.rb', line 217

def self.doc_id(*doc_ids)
  DocIdQuery.new(*doc_ids)
end

.geo_bounding_box(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude) {|query| ... } ⇒ GeoBoundingBoxQuery

Prepare GeoBoundingBoxQuery body

Parameters:

  • top_left_longitude (Float)
  • top_left_latitude (Float)
  • bottom_right_longitude (Float)
  • bottom_right_latitude (Float)

Yield Parameters:

Returns:



557
558
559
# File 'lib/couchbase/search_options.rb', line 557

def self.geo_bounding_box(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude, &block)
  GeoBoundingBoxQuery.new(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude, &block)
end

.geo_distance(longitude, latitude, distance) {|query| ... } ⇒ GeoDistanceQuery

Prepare GeoDistanceQuery body

Parameters:

  • latitude (Float)

    location latitude

  • longitude (Float)

    location longitude

  • distance (String)

    how big is area (number with units)

Yield Parameters:

Returns:



511
512
513
# File 'lib/couchbase/search_options.rb', line 511

def self.geo_distance(longitude, latitude, distance, &block)
  GeoDistanceQuery.new(longitude, latitude, distance, &block)
end

.geo_polygon(coordinates) {|query| ... } ⇒ GeoPolygonQuery

Prepare GeoPolygonQuery body

Parameters:

  • coordinates (Array<Coordinate>)

    list of coordinates that forms polygon

Yield Parameters:

Returns:



622
623
624
# File 'lib/couchbase/search_options.rb', line 622

def self.geo_polygon(coordinates, &block)
  GeoPolygonQuery.new(coordinates, &block)
end

.match(match) {|query| ... } ⇒ MatchQuery

Prepare MatchQuery body

Parameters:

  • match (String)

Yield Parameters:

Returns:



24
25
26
# File 'lib/couchbase/search_options.rb', line 24

def self.match(match, &block)
  MatchQuery.new(match, &block)
end

.match_all {|query| ... } ⇒ MatchAllQuery

Prepare MatchAllQuery body

Yield Parameters:

Returns:



933
934
935
# File 'lib/couchbase/search_options.rb', line 933

def self.match_all(&block)
  MatchAllQuery.new(&block)
end

.match_none {|query| ... } ⇒ MatchNoneQuery

Prepare MatchNoneQuery body

Yield Parameters:

Returns:



961
962
963
# File 'lib/couchbase/search_options.rb', line 961

def self.match_none(&block)
  MatchNoneQuery.new(&block)
end

.match_phrase(match_phrase) {|query| ... } ⇒ MatchPhraseQuery

Prepare MatchPhraseQuery body

Parameters:

  • match_phrase (String)

Yield Parameters:

Returns:



73
74
75
# File 'lib/couchbase/search_options.rb', line 73

def self.match_phrase(match_phrase, &block)
  MatchPhraseQuery.new(match_phrase, &block)
end

.numeric_range {|query| ... } ⇒ NumericRangeQuery

Prepare NumericRangeQuery body

Yield Parameters:

Returns:



371
372
373
# File 'lib/couchbase/search_options.rb', line 371

def self.numeric_range(&block)
  NumericRangeQuery.new(&block)
end

.phrase(*terms) {|query| ... } ⇒ PhraseQuery

Prepare PhraseQuery body

Parameters:

  • terms (*String)

Yield Parameters:

Returns:



897
898
899
# File 'lib/couchbase/search_options.rb', line 897

def self.phrase(*terms, &block)
  PhraseQuery.new(*terms, &block)
end

.prefix(prefix) {|query| ... } ⇒ PrefixQuery

Prepare PrefixQuery body

Parameters:

  • prefix (String)

Yield Parameters:

Returns:



861
862
863
# File 'lib/couchbase/search_options.rb', line 861

def self.prefix(prefix, &block)
  PrefixQuery.new(prefix, &block)
end

.query_string(query_string) {|query| ... } ⇒ QueryStringQuery

Prepare QueryStringQuery body

Parameters:

  • query_string (String)

Yield Parameters:

Returns:



149
150
151
# File 'lib/couchbase/search_options.rb', line 149

def self.query_string(query_string, &block)
  QueryStringQuery.new(query_string, &block)
end

.regexp(regexp) {|query| ... } ⇒ RegexpQuery

Prepare RegexpQuery body

Parameters:

  • regexp (String)

Yield Parameters:

Returns:



113
114
115
# File 'lib/couchbase/search_options.rb', line 113

def self.regexp(regexp, &block)
  RegexpQuery.new(regexp, &block)
end

.term(term) {|query| ... } ⇒ TermQuery

Prepare TermQuery body

Parameters:

  • term (String)

Yield Parameters:

Returns:



814
815
816
# File 'lib/couchbase/search_options.rb', line 814

def self.term(term, &block)
  TermQuery.new(term, &block)
end

.term_range {|query| ... } ⇒ TermRangeQuery

Prepare TermRangeQuery body

Yield Parameters:

Returns:



439
440
441
# File 'lib/couchbase/search_options.rb', line 439

def self.term_range(&block)
  TermRangeQuery.new(&block)
end

.wildcard(wildcard) {|query| ... } ⇒ WildcardQuery

Prepare WildcardQuery body

Parameters:

  • wildcard (String)

Yield Parameters:

Returns:



181
182
183
# File 'lib/couchbase/search_options.rb', line 181

def self.wildcard(wildcard, &block)
  WildcardQuery.new(wildcard, &block)
end