Liking cljdoc? Tell your friends :D

clojurewerkz.elastisch.rest.index


clear-cacheclj

(clear-cache conn)
(clear-cache conn index-name)
(clear-cache conn index-name opts)

Clears index caches.

  • 0-arity clears caches for all indexes and may be a very expensive operation. Use it carefully.
  • 1-arity clears caches for a single index.

Accepted options:

  • :filter: should filter caches be cleared?
  • :field_data: should field data caches be cleared?
  • :bloom: should Bloom filter caches be cleared?
Clears index caches.

* 0-arity clears caches for *all* indexes and may be a very expensive operation. Use it carefully.
* 1-arity clears caches for a single index.

Accepted options:

* `:filter`: should filter caches be cleared?
* `:field_data`: should field data caches be cleared?
* `:bloom`: should Bloom filter caches be cleared?
sourceraw docstring

closeclj

(close conn index-name)

Closes an index.

Closes an index.
sourceraw docstring

createclj

(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.rest.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.rest.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))
```
sourceraw docstring

create-templateclj

(create-template conn template-name)
(create-template conn template-name opts)

Creates or updates a new index template.

Accepted options:

  • :template: a pattern of index name that this template will be applied to
  • :settings: the same as for create
  • :mappings: the same as for create
  • :aliases: template aliases configuration
Creates or updates a new index template.

Accepted options:

* `:template`: a pattern of index name that this template will be applied to
* `:settings`: the same as for [[create]]
* `:mappings`: the same as for [[create]]
* `:aliases`: template aliases configuration
sourceraw docstring

deleteclj

(delete conn)
(delete conn index-name)

Deletes an existing index.

Deletes an existing index.
sourceraw docstring

delete-templateclj

(delete-template conn template-name)
source

exists?clj

(exists? conn index-name)

Used to check if the index (indices) exists or not.

Used to check if the index (indices) exists or not.
sourceraw docstring

flushclj

(flush conn)
(flush conn index-name)
(flush conn index-name opts)

Flushes an index.

This causes the index by flushing data to the index storage and clearing the internal transaction log. Typically it is sufficient to let Elasticsearch when to periodically flush indexes.

  • 0-arity flushes all indexes and may be a very expensive operation. Use it carefully.
  • 1-arity flushes a single index.

Accepted options:

  • :refresh: should a refresh be performed after the flush?
Flushes an index.

This causes the index by flushing data to the index storage and clearing the internal transaction log.
Typically it is sufficient to let Elasticsearch when to periodically flush indexes.

* 0-arity flushes *all* indexes and may be a very expensive operation. Use it carefully.
* 1-arity flushes a single index.

Accepted options:

* `:refresh`: should a refresh be performed after the flush?
sourceraw docstring

get-aliasesclj

(get-aliases conn index-name)

Fetches and returns aliases for an index or multiple indexes.

Fetches and returns aliases for an index or multiple indexes.
sourceraw docstring

get-mappingclj

(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.
sourceraw docstring

get-settingsclj

(get-settings conn)
(get-settings conn index-name)

The get settings API allows to retrieve settings of an index or multiple indices.

The get settings API allows to retrieve settings of an index or multiple indices.
sourceraw docstring

get-templateclj

(get-template conn template-name)
source

openclj

(open conn index-name)

Opens an index.

Opens an index.
sourceraw docstring

optimizeclj

(optimize conn)
(optimize conn index-name)
(optimize conn index-name opts)

Optimizes an index.

Optimization makes searches over the index faster and also reclaims some disk space used by deleted documents. Optionally you can optimize and refresh an index in a single request.

  • 0-arity optimizes all indexes and may be a very expensive operation. Use it carefully.
  • 1-arity optimizes a single index.

Accepted options:

  • :max_num_segments: the number of segments to optimize to.
  • :only_expunge_deletes: should the optimize process only expunge segments with deleted documents in it?
  • :refresh: when set to true, refreshes the index
  • :flush: when set to true, flushes the index
  • :wait_for_merge: should the request wait for the merge to end?
Optimizes an index.

Optimization makes searches over the index faster and also reclaims some disk space used by
deleted documents. Optionally you can optimize and refresh an index in a single request.

* 0-arity optimizes *all* indexes and may be a very expensive operation. Use it carefully.
* 1-arity optimizes a single index.

Accepted options:

* `:max_num_segments`: the number of segments to optimize to.
* `:only_expunge_deletes`: should the optimize process only expunge segments with deleted documents in it?
* `:refresh`: when set to `true`, refreshes the index
* `:flush`: when set to `true`, flushes the index
* `:wait_for_merge`: should the request wait for the merge to end?
sourceraw docstring

recoveryclj

(recovery conn index-name)

TODO refine description AND resolve the above issue

TODO refine description AND resolve the above issue
sourceraw docstring

refreshclj

(refresh conn)
(refresh conn index-name)

Refreshes an index manually.

Refreshing an index makes all changes (added, modified and deleted documents) since the last refresh available for search. In other words, index changes become "visible" to clients. Elasticsearch periodically refreshes indexes, the period is configurable via index settings.

  • 0-arity updates all indexes and may be a very expensive operation. Use it carefully.
  • 1-arity refreshes a single index.
Refreshes an index manually.

Refreshing an index makes all changes (added, modified and deleted documents) since the last refresh available for search. In other
words, index changes become "visible" to clients. Elasticsearch periodically refreshes indexes, the period is configurable via index
settings.

* 0-arity updates *all* indexes and may be a very expensive operation. Use it carefully.
* 1-arity refreshes a single index.
sourceraw docstring

segmentsclj

(segments conn)
(segments conn index-name)

Returns segments information for an index or multiple indexes.

Returns segments information for an index or multiple indexes.
sourceraw docstring

snapshotclj

(snapshot conn index-name)

Takes a snapshot of an index or multiple indexes.

Takes a snapshot of an index or multiple indexes.
sourceraw docstring

statsclj

(stats conn index-name)
(stats conn index-name opts)

Returns statistics about an index or multiple indexes

Accepted options define what exactly will be contained in the response:

  • :stats: the specific stat(s) to return (defaults to all)
  • :types: combined with index stats to provide document type level stats
  • :groups: search statistics can be associated with one or more groups
  • :fields: fields to be included in the statistics by default where applicable
  • :completion_fields: fields to be included in the completion suggest statistics
  • :fielddata_fields: fields to be included in the fielddata statistics

API Reference: https://www.elastic.co/guide/en/elasticsearch/reference/1.5/indices-stats.html

Returns statistics about an index or multiple indexes

Accepted options define what exactly will be contained in the response:

* `:stats`: the specific stat(s) to return (defaults to all)
* `:types`: combined with index stats to provide document type level stats
* `:groups`: search statistics can be associated with one or more groups
* `:fields`: fields to be included in the statistics by default where applicable
* `:completion_fields`: fields to be included in the completion suggest statistics
* `:fielddata_fields`: fields to be included in the fielddata statistics

API Reference: <https://www.elastic.co/guide/en/elasticsearch/reference/1.5/indices-stats.html>
sourceraw docstring

type-exists?clj

(type-exists? conn index-name type-name)

Used to check if a type/types exists in an index/indices.

Used to check if a type/types exists in an index/indices.
sourceraw docstring

update-aliasesclj

(update-aliases conn & actions)

Performs a batch of alias operations. Takes a collection of actions in the form of

{ :add    { :index "test1" :alias "alias1" } }
{ :remove { :index "test1" :alias "alias1" } }
Performs a batch of alias operations. Takes a collection of actions in the form of

```edn
{ :add    { :index "test1" :alias "alias1" } }
{ :remove { :index "test1" :alias "alias1" } }
```
sourceraw docstring

update-mappingclj

(update-mapping conn index-name-or-names type-name 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.
sourceraw docstring

update-settingsclj

(update-settings conn settings)
(update-settings conn index-name settings)

Change specific index level settings in real time.

Change specific index level settings in real time.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close