Class: Couchbase::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

Instance Method Summary collapse

Class Method Details

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

Prepare BooleanFieldQuery body

Parameters:

  • value (Boolean)

Yield Parameters:

Returns:



322
323
324
# File 'lib/couchbase/search_options.rb', line 322

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

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

Prepare BooleanQuery body

Yield Parameters:

Returns:



820
821
822
# File 'lib/couchbase/search_options.rb', line 820

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

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

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



728
729
730
# File 'lib/couchbase/search_options.rb', line 728

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

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

Prepare DateRangeQuery body

Yield Parameters:

Returns:



357
358
359
# File 'lib/couchbase/search_options.rb', line 357

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

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

Prepare ConjunctionQuery body

Yield Parameters:

Returns:



770
771
772
# File 'lib/couchbase/search_options.rb', line 770

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

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

Prepare DocIdQuery body

Parameters:

  • doc_ids (String...)

Yield Parameters:

Returns:



290
291
292
# File 'lib/couchbase/search_options.rb', line 290

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:



626
627
628
# File 'lib/couchbase/search_options.rb', line 626

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:



580
581
582
# File 'lib/couchbase/search_options.rb', line 580

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:

Stability:

  • Uncommitted: This API may change in the future.



691
692
693
# File 'lib/couchbase/search_options.rb', line 691

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

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

Prepare MatchQuery body

Parameters:

  • match (String)

Yield Parameters:

Returns:



95
96
97
# File 'lib/couchbase/search_options.rb', line 95

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

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

Prepare MatchAllQuery body

Yield Parameters:

Returns:



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

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

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

Prepare MatchNoneQuery body

Yield Parameters:

Returns:



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

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:



146
147
148
# File 'lib/couchbase/search_options.rb', line 146

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

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

Prepare NumericRangeQuery body

Yield Parameters:

Returns:



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

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

.phrasePhraseQuery

Prepare PhraseQuery body

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

Returns:



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

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

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

Prepare PrefixQuery body

Parameters:

  • prefix (String)

Yield Parameters:

Returns:



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

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:



222
223
224
# File 'lib/couchbase/search_options.rb', line 222

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:



186
187
188
# File 'lib/couchbase/search_options.rb', line 186

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

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

Prepare TermQuery body

Parameters:

  • term (String)

Yield Parameters:

Returns:



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

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

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

Prepare TermRangeQuery body

Yield Parameters:

Returns:



508
509
510
# File 'lib/couchbase/search_options.rb', line 508

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

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

Prepare WildcardQuery body

Parameters:

  • wildcard (String)

Yield Parameters:

Returns:



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

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

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



80
81
82
# File 'lib/couchbase/search_options.rb', line 80

def to_h
  {}
end

#to_json(*args) ⇒ String

Returns:

  • (String)


85
86
87
# File 'lib/couchbase/search_options.rb', line 85

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