zensols.dataset.elsearch
A client simple wrapper for an Elasticsearch wrapper. You probably want use the more client friendly zensols.dataset.db.
buckets
(buckets by-field)
Do an aggregation search and bucket by-field.
Return maps with keys:
- :name value of name given by by-field
- :count the count of the bucket
create-context
(create-context index-name mapping-type & {:keys [url mapping-type-defs settings], :or {url "http://localhost:9200", mapping-type-defs {:properties {mapping-type {}}}}})
Create a new context to be used with with-context.
Parameters
- index-name the name of the Elasticsearch index
- mapping-type map type name (see ES docs)
Keys
- :url the URL to the DB (defaults to
http://localhost:9200
) - :mapping-type-defs metadata (see ES docs)
document-ids
(document-ids)
(document-ids query)
Return document IDs only. The query default to match_all
.
search
(search query)
Return a lazy sequence of documents. Scanning is the underlying elastic search method here.
search-literal
(search-literal query)
Return a lazy sequence of documents. Scanning is the underlying elastic search method here.
with-context
macro
(with-context exprs & forms)
Execute a body with the form (with-context [context
- context is created with create-context
- keys… option keys to override what was giving in create-context