class LuckySearch::SimpleQuery(T, K)
- LuckySearch::SimpleQuery(T, K)
- Reference
- Object
Defined in:
lucky_search/simple_query.crConstant Summary
-
COUNT =
"count" -
HITS =
"hits" -
ID =
"_id" -
SCORE =
["_score"] -
SOURCE =
"_source" -
TOTAL =
"total" -
TYPE =
"_document_type" -
VALUE =
"value"
Constructors
Instance Method Summary
-
#client
Yields the elasticsearch client
-
#count(builder = Query.new)
Performs a count query against an index
-
#elastic_document_name : String
Document type defaults to class name without namespace
-
#elastic_index : String
Index defaults to avram table name
- #generate_body(builder)
- #query(q : String, params = {} of Symbol => String, filters = nil)
-
#query(params = {} of Symbol => String, filters = nil)
Safely build the query
-
#search(builder)
Query elasticsearch with a query builder object
-
#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.
Constructor Detail
Instance Method Detail
def 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.