class

Neuroplastic::Query

Inherits Reference < Object

Constants

RANGE_PARAMS = {:gte, :gt, :lte, :lt, :boost}

Constructors

new(params : HTTP::Params | Hash(String, String | Array(String)) | Hash(Symbol, String | Array(String)) = {} of String => String)
Source
new(search : String, limit : Int32 = 100, offset : Int32 = 0)
Source

Instance methods

aggs
Source
avg(name : String, field : String)
Source
build
Source
cardinality(name : String, field : String)
Source
child
Source
date_histogram(name : String, field : String, *, calendar_interval : String | Nil = nil, fixed_interval : String | Nil = nil, format : String | Nil = nil, min_doc_count : Int | Nil = nil)
Source
date_histogram(name : String, field : String, *, calendar_interval : String | Nil = nil, fixed_interval : String | Nil = nil, format : String | Nil = nil, min_doc_count : Int | Nil = nil, &)
Source
exists(*fields)
Source
fields
Source
filter(name : String, filters : Filter)
Source
filter(filters : Filter)
Source
filter(name : String, filters : Filter, &)
Source
filters(name : String, filters : NamedFilters, *, other_bucket : Bool | Nil = nil, other_bucket_key : String | Nil = nil)
Source
filters
Source
filters(name : String, filters : NamedFilters, *, other_bucket : Bool | Nil = nil, other_bucket_key : String | Nil = nil, &)
Source
has_child(child : Class)

Applies the query to child objects

Source
has_parent(parent : Class, parent_index : String)

"has_parent" query.

Sets the index to the parent

Source
index
Source
limit
Source
max(name : String, field : String)
Source
min(name : String, field : String)
Source
minimum_should_match(count : Int)
Source
minimum_should_match
Source
missing(name : String, field : String)
Source
missing(*fields)

Call to add fields that should be missing Effectively adds a filter that ensures a field is missing

Source
must(filters : Filter)

Like filter, but all hits must match each filter

Source
must
Source
must_not(filters : Filter)

The opposite of filter, essentially a not

Source
must_not
Source
nested(name : String, path : String)
Source
nested(name : String, path : String, &)
Source
offset
Source
parent
Source
query_settings
Source
range(name : String, field : String, ranges : AggRanges, *, keyed : Bool | Nil = nil)
Source
range(filter)
Source
range
Source
range(name : String, field : String, ranges : AggRanges, *, keyed : Bool | Nil = nil, &)
Source
raw_filter(clause : JSON::Any)

Append a raw Elasticsearch clause verbatim into the bool filter array. Use for clauses the typed DSL can't express — e.g. a should/ minimum_should_match group combining a range with a missing-field check, or an OR across two range fields.

Source
raw_filters

Raw Elasticsearch clauses appended verbatim into the bool filter array.

Source
reverse_nested(name : String, path : String | Nil = nil)
Source
reverse_nested(name : String, path : String | Nil = nil, &)
Source
search
Source
search_after
Source
search_field(field)
Source
should(filters : Filter)

Like filter, but at least one should match in absence of filter/must hits

Source
should
Source
sort(sort : Sort)
Source
sort
Source
stats(name : String, field : String)
Source
sum(name : String, field : String)
Source
terms(name : String, field : String, *, size : Int | Nil = nil, order : Hash(String, String) | Nil = nil, min_doc_count : Int | Nil = nil)
Source
terms(name : String, field : String, *, size : Int | Nil = nil, order : Hash(String, String) | Nil = nil, min_doc_count : Int | Nil = nil, &)
Source

Nested types