Class: Couchbase::SearchQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/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

Instance Method Summary collapse

Class Method Details

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

Prepare BooleanFieldQuery body

Parameters:

  • value (Boolean)

Yield Parameters:

Returns:



320
321
322
# File 'lib/couchbase/search_options.rb', line 320

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

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

Prepare BooleanQuery body

Yield Parameters:

Returns:



818
819
820
# File 'lib/couchbase/search_options.rb', line 818

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

.conjuncts {|query| ... } ⇒ ConjunctionQuery

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



726
727
728
# File 'lib/couchbase/search_options.rb', line 726

def self.conjuncts(...)
  ConjunctionQuery.new(...)
end

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

Prepare DateRangeQuery body

Yield Parameters:

Returns:



355
356
357
# File 'lib/couchbase/search_options.rb', line 355

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

.disjuncts {|query| ... } ⇒ DisjunctionQuery

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



768
769
770
# File 'lib/couchbase/search_options.rb', line 768

def self.disjuncts(...)
  DisjunctionQuery.new(...)
end

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

Prepare DocIdQuery body

Parameters:

  • doc_ids (String...)

Yield Parameters:

Returns:



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

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:



624
625
626
# File 'lib/couchbase/search_options.rb', line 624

def self.geo_bounding_box(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude, &)
  GeoBoundingBoxQuery.new(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude, &)
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:



578
579
580
# File 'lib/couchbase/search_options.rb', line 578

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

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

Prepare GeoPolygonQuery body

Parameters:

  • coordinates (Array<Coordinate>) —

    list of coordinates that forms polygon

Yield Parameters:

Returns:

Stability:

  • Uncommitted: This API may change in the future.



689
690
691
# File 'lib/couchbase/search_options.rb', line 689

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

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

Prepare MatchQuery body

Parameters:

  • match (String)

Yield Parameters:

Returns:



93
94
95
# File 'lib/couchbase/search_options.rb', line 93

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

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

Prepare MatchAllQuery body

Yield Parameters:

Returns:



1003
1004
1005
# File 'lib/couchbase/search_options.rb', line 1003

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

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

Prepare MatchNoneQuery body

Yield Parameters:

Returns:



1026
1027
1028
# File 'lib/couchbase/search_options.rb', line 1026

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

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

Prepare MatchPhraseQuery body

Parameters:

  • match_phrase (String)

Yield Parameters:

Returns:



144
145
146
# File 'lib/couchbase/search_options.rb', line 144

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

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

Prepare NumericRangeQuery body

Yield Parameters:

Returns:



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

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

.phrase ⇒ PhraseQuery

Prepare PhraseQuery body

Creates a new instances PhraseQuery passing all parameters into Couchbase::SearchQuery::PhraseQuery#initialize.

Returns:



967
968
969
# File 'lib/couchbase/search_options.rb', line 967

def self.phrase(...)
  PhraseQuery.new(...)
end

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

Prepare PrefixQuery body

Parameters:

  • prefix (String)

Yield Parameters:

Returns:



929
930
931
# File 'lib/couchbase/search_options.rb', line 929

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

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

Prepare QueryStringQuery body

Parameters:

  • query_string (String)

Yield Parameters:

Returns:



220
221
222
# File 'lib/couchbase/search_options.rb', line 220

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

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

Prepare RegexpQuery body

Parameters:

  • regexp (String)

Yield Parameters:

Returns:



184
185
186
# File 'lib/couchbase/search_options.rb', line 184

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

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

Prepare TermQuery body

Parameters:

  • term (String)

Yield Parameters:

Returns:



882
883
884
# File 'lib/couchbase/search_options.rb', line 882

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

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

Prepare TermRangeQuery body

Yield Parameters:

Returns:



506
507
508
# File 'lib/couchbase/search_options.rb', line 506

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

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

Prepare WildcardQuery body

Parameters:

  • wildcard (String)

Yield Parameters:

Returns:



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

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

Instance Method Details

#to_h ⇒ Hash<Symbol, #to_json>

Returns:



78
79
80
# File 'lib/couchbase/search_options.rb', line 78

def to_h
  {}
end

#to_json ⇒ String

Returns:

  • (String)


83
84
85
# File 'lib/couchbase/search_options.rb', line 83

def to_json(*)
  to_h.to_json(*)
end