clojurewerkz.elastisch.rest.response/facets-from
is a new convenience function that returns the facets section of a response.
The exact response format will vary between facet types and queries but it is always returned as an immutable map and has the same
structure as in the respective ElasticSearch response JSON document.
Elastisch now depends on org.clojure/clojure
version 1.4.0
. It is still compatible with Clojure 1.3 and if your project.clj
depends
on 1.3, it will be used, but 1.4 is the default now.
We encourage all users to upgrade to 1.4, it is a drop-in replacement for the majority of projects out there.
ElasticSearch 0.19.9 renames Text Query to Match Query. Elastisch adapts by introducing clojurewerkz.elastisch.query/match
that
is effectively an alias for clojurewerkz.elastisch.query/text
(ElasticSearch still supports :text
in the query DSL for backwards
compatibility).
Documentation guides were greatly improved.
clj-http dependency has been upgraded to version 0.5.1
.
clojurewerkz.elastisch.query/text
now takes two arguments, the first being the name of the field.
It was mistakenly hardcoded previously.¯
clojurewerkz.elastisch.rest.index/create-template
, clojurewerkz.elastisch.rest.index/delete-template
and clojurewerkz.elastisch.rest.index/get-template
are new functions that implement support for index templates:
(clojurewerkz.elastisch.rest.index/create-template "accounts" :template "account*" :settings {:index {:refresh_interval "60s"}})
(clojurewerkz.elastisch.rest.index/get-template "accounts")
(clojurewerkz.elastisch.rest.index/delete-template "accounts")
clojurewerkz.elastisch.rest.index/update-aliases
and clojurewerkz.elastisch.rest.index/get-aliases
are new functions that implement support for index aliases:
(clojurewerkz.elastisch.rest.index/update-aliases [{:add {:index "client0000001" :alias "alias1"}}
{:add {:index "client0000002" :alias "alias2"}}])
(clojurewerkz.elastisch.rest.index/get-aliases "client0000001")
clojurewerkz.elastisch.rest.index/optimize
is a function that optimizes an index:
(clojurewerkz.elastisch.rest.index/optimize "my-index" :refresh true :max_num_segments 48)
clojurewerkz.elastisch.rest.index/flush
is a function that flushes an index:
(clojurewerkz.elastisch.rest.index/flush "my-index" :refresh true)
clojurewerkz.elastisch.rest.index/snapshot
is a function that takes a snapshot of an index or multiple indexes:
(clojurewerkz.elastisch.rest.index/snapshot "my-index")
clojurewerkz.elastisch.rest.index/clear-cache
is a function that can be used to clear index caches:
(clojurewerkz.elastisch.rest.index/clear-cache "my-index" :filter true :field_data true)
It takes the same options as documented in the ElasticSearch guide on the Clear Cache Index operation
clojurewerkz.elastisch.rest.index/status
is a function that returns status an index or multple indexes:
(clojurewerkz.elastisch.rest.index/status "my-index" :recovery true :snapshot true)
clojurewerkz.elastisch.rest.index/segments
is a function that returns segments information for an index or multiple indexes:
(clojurewerkz.elastisch.rest.index/segments "my-index")
clojurewerkz.elastisch.rest.index/stats
is a function that returns statistics for an index or multiple indexes:
(clojurewerkz.elastisch.rest.index/stats "my-index" :docs true :store true :indexing true)
It takes the same options as documented in the ElasticSearch guide on the Stats Index operation
clj-http dependency has been upgraded to version 0.5.0
.
clojurewerkz.elastisch.rest.document/delete-by-query-across-all-types
is a new function that searches across
one or more indexes and all mapping types:
(doc/delete-by-query-across-all-types index-name (q/term :username "esjoe"))
clojurewerkz.elastisch.rest.document/delete-by-query-across-all-indexes-and-types
is another new function that searches across all indexes and all mapping types:
(doc/delete-by-query-across-all-indexes-and-types (q/term :username "esjoe"))
clojurewerkz.elastisch.rest.document/search-all-types
is a new function that searches across
one or more indexes and all mapping types:
(doc/search-all-types ["customer1_index" "customer2_index"] :query (q/query-string :query "Austin" :default_field "title"))
clojurewerkz.elastisch.rest.document/search-all-indexes-and-types
is another new function that searches across all indexes and all mapping types:
(doc/search-all-indexes-and-types :query (q/query-string :query "Austin" :default_field "title"))
It is now possible to create indexes without specifying mapping types: clojurewerkz.elastisch.rest.index/create
no longer requires :mapping
to be passed.
Elastisch now uses clj-http 0.4.x.
HTTP/REST API namespaces are now grouped under clojurewerkz.elastisch.rest
, for example, what used to be clojurewerkz.elastisch.document
is now
clojurewerkz.elastisch.rest.document
. This is done to leave room for Memcached transport support in the future.
Elastisch now supports Custom Filters Score queries.
Elastisch now supports Nested queries.
Elastisch now supports Indices queries.
Elastisch now supports Top Children queries.
Elastisch now supports Has Child queries.
Elastisch now supports Wildcard queries.
Elastisch now supports span queries:
Span queries are used for proximity search.
Elastisch now supports Query String queries.
Elastisch now supports More Like This Field queries.
clj-time dependency has been upgraded to version 0.4.1.
Elastisch now supports More Like This queries.
Elastisch now supports match all queries.
Elastisch now supports fuzzy (edit distance) queries.
Elastisch now supports fuzzy like this and fuzzy like this field queries.
Elastisch now supports prefix queries, see clojurewerkz.elastisch.query/prefix
,
clojurewerkz.elastisch.query/field
, clojurewerkz.elastisch.query/filtered
, and clojurewerkz.elastisch.document/search
to learn more.
clojurewerkz.elastisch.document/more-like-this
provides access to the Elastic Search More Like This API for
documents and returns documents similar to a given one:
(doc/more-like-this "people" "person" "1" :min_term_freq 1 :min_doc_freq 1)
Please note that :min_doc_freq
and :min_term_freq
parameters may be very important for small data sets.
If you observe responses with no results, try lowering them.
clojurewerkz.elastisch.document/count
provides access to the Elastic Search count API
and is almost always used with a query, for example:
(doc/count "people" "person" (q/term :username "clojurewerkz"))
clojurewerkz.elastisch.document/delete-by-query
provides access to the Delete by query API of Elastic Search, for example:
(doc/delete-by-query "people" "person" (q/term :tag "mongodb"))
clojurewerkz.elastisch.document/replace
deletes a document by id and immediately adds a new one
with the same id.
clojurewerkz.elastisch.response
was extracted from clojurewerkz.elastisch.utils
Elastisch now uses Leiningen 2.