Class: Couchbase::SearchQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/search_options.rb,
/code/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:



324
325
326
# File 'lib/couchbase/search_options.rb', line 324

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

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

Prepare BooleanQuery body

Yield Parameters:

Returns:



822
823
824
# File 'lib/couchbase/search_options.rb', line 822

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

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

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



730
731
732
# File 'lib/couchbase/search_options.rb', line 730

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

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

Prepare DateRangeQuery body

Yield Parameters:

Returns:



359
360
361
# File 'lib/couchbase/search_options.rb', line 359

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

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

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



772
773
774
# File 'lib/couchbase/search_options.rb', line 772

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

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

Prepare DocIdQuery body

Parameters:

  • doc_ids (String...)

Yield Parameters:

Returns:



292
293
294
# File 'lib/couchbase/search_options.rb', line 292

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:



628
629
630
# File 'lib/couchbase/search_options.rb', line 628

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:



582
583
584
# File 'lib/couchbase/search_options.rb', line 582

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.



693
694
695
# File 'lib/couchbase/search_options.rb', line 693

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

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

Prepare MatchQuery body

Parameters:

  • match (String)

Yield Parameters:

Returns:



97
98
99
# File 'lib/couchbase/search_options.rb', line 97

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

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

Prepare MatchAllQuery body

Yield Parameters:

Returns:



1007
1008
1009
# File 'lib/couchbase/search_options.rb', line 1007

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

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

Prepare MatchNoneQuery body

Yield Parameters:

Returns:



1030
1031
1032
# File 'lib/couchbase/search_options.rb', line 1030

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

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

Prepare MatchPhraseQuery body

Parameters:

  • match_phrase (String)

Yield Parameters:

Returns:



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

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

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

Prepare NumericRangeQuery body

Yield Parameters:

Returns:



442
443
444
# File 'lib/couchbase/search_options.rb', line 442

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

.phrasePhraseQuery

Prepare PhraseQuery body

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

Returns:



971
972
973
# File 'lib/couchbase/search_options.rb', line 971

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

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

Prepare PrefixQuery body

Parameters:

  • prefix (String)

Yield Parameters:

Returns:



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

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

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

Prepare QueryStringQuery body

Parameters:

  • query_string (String)

Yield Parameters:

Returns:



224
225
226
# File 'lib/couchbase/search_options.rb', line 224

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

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

Prepare RegexpQuery body

Parameters:

  • regexp (String)

Yield Parameters:

Returns:



188
189
190
# File 'lib/couchbase/search_options.rb', line 188

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

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

Prepare TermQuery body

Parameters:

  • term (String)

Yield Parameters:

Returns:



886
887
888
# File 'lib/couchbase/search_options.rb', line 886

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

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

Prepare TermRangeQuery body

Yield Parameters:

Returns:



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

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

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

Prepare WildcardQuery body

Parameters:

  • wildcard (String)

Yield Parameters:

Returns:



256
257
258
# File 'lib/couchbase/search_options.rb', line 256

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

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



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

def to_h
  {}
end

#to_json(*args) ⇒ String

Returns:

  • (String)


87
88
89
# File 'lib/couchbase/search_options.rb', line 87

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