class

LuckySearch::SimpleQuery(T, K)

Inherits Reference < Object

Constants

COUNT = "count"
HITS = "hits"
ID = "_id"
SCORE = ["_score"]
SOURCE = "_source"
TOTAL = "total"
TYPE = "_document_type"
VALUE = "value"

Constructors

new(elastic_index : String | Nil = nil, document_name : String | Nil = nil)
Source

Instance methods

client

Yields the elasticsearch client

Source
count(builder = Query.new)

Performs a count query against an index

Source
elastic_document_name

Document type defaults to class name without namespace

Source
elastic_index

Index defaults to avram table name

Source
generate_body(builder)
Source
query(q : String, params = {} of Symbol => String, filters = nil)
Source
query(params = {} of Symbol => String, filters = nil)

Safely build the query

Source
search(builder)

Query elasticsearch with a query builder object

Source
search(builder, &block : Proc(T, T | Nil))

Query elasticsearch with a query builder object, accepts a formatter block Allows annotation/conversion of records using data from the model. Nils are removed from the list.

Source