class Neuroplastic::Elastic(T)
- Neuroplastic::Elastic(T)
- Reference
- Object
Defined in:
neuroplastic/elastic.crConstant Summary
-
COUNT =
"count" -
HITS =
"hits" -
ID =
"_id" -
Log =
::Log.for("search") -
SCORE =
["_score"] -
SOURCE =
"_source" -
TOTAL =
"total" -
TYPE =
"_document_type" -
VALUE =
"value"
Constructors
Instance Method Summary
-
#client
Yields the elasticsearch client
-
#count(builder)
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 rethinkdb table name
- #generate_body(builder)
-
#query(params = {} of Symbol => String | Array(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
Safely build the query
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.