(clear-cache conn index-name)
(clear-cache conn index-name opts)
Clears caches index or multiple indices
Clears caches index or multiple indices
(close conn index-name)
Closes an index or indices
Usage:
(idx/close conn "my-index")
(idx/close conn ["my-index" "dein-index"])
Closes an index or indices Usage: ```clojure (idx/close conn "my-index") (idx/close conn ["my-index" "dein-index"]) ```
(create conn index-name)
(create conn index-name opts)
Creates an index.
Accepted options are :mappings
and :settings
. Both accept maps with the same structure as in the REST API.
Examples:
(require '[clojurewerkz.elastisch.native.index :as idx])
(idx/create conn "myapp_development")
(idx/create conn "myapp_development" {:settings {"number_of_shards" 1}})
(let [mapping-types {:person {:properties {:username {:type "string" :store "yes"}
:first-name {:type "string" :store "yes"}
:last-name {:type "string"}
:age {:type "integer"}
:title {:type "string" :analyzer "snowball"}
:planet {:type "string"}
:biography {:type "string" :analyzer "snowball" :term_vector "with_positions_offsets"}}}}]
(idx/create conn "myapp_development" {:mappings mapping-types}))
Creates an index. Accepted options are `:mappings` and `:settings`. Both accept maps with the same structure as in the REST API. Examples: ```clojure (require '[clojurewerkz.elastisch.native.index :as idx]) (idx/create conn "myapp_development") (idx/create conn "myapp_development" {:settings {"number_of_shards" 1}}) (let [mapping-types {:person {:properties {:username {:type "string" :store "yes"} :first-name {:type "string" :store "yes"} :last-name {:type "string"} :age {:type "integer"} :title {:type "string" :analyzer "snowball"} :planet {:type "string"} :biography {:type "string" :analyzer "snowball" :term_vector "with_positions_offsets"}}}}] (idx/create conn "myapp_development" {:mappings mapping-types})) ```
(create-template conn template-name)
(create-template conn template-name opts)
(delete conn)
(delete conn index-name)
Deletes an existing index
Deletes an existing index
(exists? conn index-name)
Returns true
if given index (or indices) exists
Returns `true` if given index (or indices) exists
(flush conn index-name)
(flush conn index-name opts)
Flushes an index or multiple indices
Flushes an index or multiple indices
(force-merge conn index-name)
(force-merge conn index-name opts)
Optimizes an index or multiple indices
Optimizes an index or multiple indices
(get-aliases conn)
(get-aliases conn indices)
Fetches and returns the aliases for the given indices. Returns all aliases if no indices are given.
Fetches and returns the aliases for the given indices. Returns all aliases if no indices are given.
(get-mapping conn index-name)
(get-mapping conn index-name type-name)
The get mapping API allows to retrieve mapping definition of index or index/type.
The get mapping API allows to retrieve mapping definition of index or index/type.
(get-settings conn index-name)
Gets index settings.
Gets index settings.
(refresh conn index-name)
Refreshes an index or multiple indices
Refreshes an index or multiple indices
(segments conn index-name)
Returns segments information for one or more indices.
Returns segments information for one or more indices.
(stats conn)
(stats conn opts)
Returns statistics about indexes.
No argument version returns all stats. Options may be used to define what exactly will be contained in the response:
:docs
: the number of documents, deleted documents:store
: the size of the index:indexing
: indexing statistics:types
: document type level stats:groups
: search group stats to retrieve the stats for:get
: get operation statistics, including missing stats:search
: search statistics, including custom grouping using the groups parameter (search operations can be associated with one or more groups):merge
: merge operation stats:flush
: flush operation stats:refresh
: refresh operation statsReturns statistics about indexes. No argument version returns all stats. Options may be used to define what exactly will be contained in the response: * `:docs`: the number of documents, deleted documents * `:store`: the size of the index * `:indexing`: indexing statistics * `:types`: document type level stats * `:groups`: search group stats to retrieve the stats for * `:get`: get operation statistics, including missing stats * `:search`: search statistics, including custom grouping using the groups parameter (search operations can be associated with one or more groups) * `:merge`: merge operation stats * `:flush`: flush operation stats * `:refresh`: refresh operation stats
(type-exists? conn index-name type-name)
Returns true
if a type/types exists in an index/indices
Returns `true` if a type/types exists in an index/indices
(update-aliases conn ops)
(update-aliases conn ops opts)
Performs a batch of alias operations. Takes a collection of actions in the following form where plural keys (indices, aliases) can be supplied as collections or single strings
[{:add { :indices "test1" :alias "alias1" }}
{:remove { :index "test1" :aliases "alias1" }}]
Performs a batch of alias operations. Takes a collection of actions in the following form where plural keys (indices, aliases) can be supplied as collections or single strings ```edn [{:add { :indices "test1" :alias "alias1" }} {:remove { :index "test1" :aliases "alias1" }}] ```
(update-mapping conn index-name mapping-type opts)
The put mapping API allows to register or modify specific mapping definition for a specific type.
The put mapping API allows to register or modify specific mapping definition for a specific type.
(update-settings conn index-name settings)
Updates index settings. No argument version updates index settings globally
Updates index settings. No argument version updates index settings globally
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close