class LuckySearch::Query

Defined in:

lucky_search/query.cr

Constant Summary

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

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(params : HTTP::Params | Hash(String, String) | Hash(Symbol, String) = {} of String => String) #

[View source]
def self.new(search : String, limit : Int32 = 100, offset : Int32 = 0) #

[View source]

Class Method Detail

def self.document_name(klass : Class) : String #

[View source]

Instance Method Detail

def build #

[View source]
def child : String | Nil #

[View source]
def exists(*fields) #

[View source]
def fields : Array(String) #

[View source]
def filter(filters : Filter) #

[View source]
def filters : Filter #

[View source]
def has_child(child : Class) #

Applies the query to child objects


[View source]
def has_parent(parent : Class, parent_index : String) #

"has_parent" query.

Sets the index to the parent


[View source]
def index : String | Nil #

[View source]
def limit : Int32 #

[View source]
def missing(*fields) #

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


[View source]
def must(filters : Filter) #

Like filter, but all hits must match each filter


[View source]
def must : Filter #

[View source]
def must_not(filters : Filter) #

The opposite of filter, essentially a not


[View source]
def must_not : Filter #

[View source]
def offset : Int32 #

[View source]
def parent : String | Nil #

[View source]
def query_settings : Hash(String, String) | Nil #

[View source]
def range(filter) #

[View source]
def range : RangeQuery #

[View source]
def search : String #

[View source]
def search_field(field) #

[View source]
def should(filters : Filter) #

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


[View source]
def should : Filter #

[View source]
def sort(sort : Sort) #

[View source]
def sort : Array(Sort) #

[View source]