Note
|
At this time, you must opt into the 2.1 API by setting the apiVersion config parameter.
|
client.bulk([params, [callback]])
Perform many index/delete operations in a single API call.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.bulk({
body: [
// action description
{ index: { _index: 'myindex', _type: 'mytype', _id: 1 } },
// the document to index
{ title: 'foo' },
// action description
{ update: { _index: 'myindex', _type: 'mytype', _id: 2 } },
// the document to update
{ doc: { title: 'foo' } },
// action description
{ delete: { _index: 'myindex', _type: 'mytype', _id: 3 } },
// no document needed for this delete
]
}, function (err, resp) {
// ...
});
Params
consistency
|
|
refresh
|
|
routing
|
|
timeout
|
|
type
|
|
fields
|
|
index
|
|
client.clearScroll([params, [callback]])
Clear the scroll request created by specifying the scroll parameter to search.
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
scrollId
|
|
client.count([params, [callback]])
Get the number of documents for the cluster, index, type, or a query.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.count(function (error, response, status) {
// check for and handle error
var count = response.count;
});
client.count({
index: 'index_name'
}, function (error, response) {
// ...
});
client.count({
index: 'index_name',
body: {
query: {
filtered: {
filter: {
terms: {
foo: ['bar']
}
}
}
}
}
}, function (err, response) {
// ...
});
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
minScore
|
|
preference
|
|
routing
|
|
q
|
|
analyzer
|
|
analyzeWildcard
|
|
[defaultOperator=OR]
|
|
df
|
|
lenient
|
|
lowercaseExpandedTerms
|
|
index
|
|
type
|
|
client.countPercolate([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
routing
|
|
preference
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
percolateIndex
|
|
percolateType
|
|
version
|
|
versionType
|
|
index
|
|
type
|
|
id
|
|
client.create([params, [callback]])
Adds a typed JSON document in a specific index, making it searchable. If a document with the same index
, type
, and id
already exists, an error will occur.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.create({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
title: 'Test 1',
tags: ['y', 'z'],
published: true,
published_at: '2013-01-01',
counter: 1
}
}, function (error, response) {
// ...
});
Params
consistency
|
|
parent
|
|
refresh
|
|
routing
|
|
timeout
|
|
timestamp
|
|
ttl
|
|
version
|
|
versionType
|
|
id
|
|
index
|
|
type
|
|
client.delete([params, [callback]])
Delete a typed JSON document from a specific index based on its id.
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
/myindex/mytype/1
client.delete({
index: 'myindex',
type: 'mytype',
id: '1'
}, function (error, response) {
// ...
});
Params
consistency
|
|
parent
|
|
refresh
|
|
routing
|
|
timeout
|
|
version
|
|
versionType
|
|
id
|
|
index
|
|
type
|
|
client.deleteScript([params, [callback]])
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
version
|
|
versionType
|
|
id
|
|
lang
|
|
client.deleteTemplate([params, [callback]])
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
version
|
|
versionType
|
|
id
|
|
client.exists([params, [callback]])
Returns a boolean indicating whether or not a given document exists.
The default method is HEAD
and the usual params and return values apply. See the elasticsearch docs for more about this method.
/myindex/mytype/1
existclient.exists({
index: 'myindex',
type: 'mytype',
id: 1
}, function (error, exists) {
if (exists === true) {
// ...
} else {
// ...
}
});
Params
parent
|
|
preference
|
|
realtime
|
|
refresh
|
|
routing
|
|
id
|
|
index
|
|
type
|
|
client.explain([params, [callback]])
Provides details about a specific document’s score in relation to a specific query. It will also tell you if the document matches the specified query. Also check out percolaters.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.explain({
// the document to test
index: 'myindex',
type: 'mytype',
id: '1',
// the query to score it against
q: 'field:value'
}, function (error, response) {
// ...
});
client.explain({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
query: {
match: { title: 'test' }
}
}
}, function (error, response) {
// ...
});
Params
analyzeWildcard
|
|
analyzer
|
|
[defaultOperator=OR]
|
|
df
|
|
fields
|
|
lenient
|
|
lowercaseExpandedTerms
|
|
parent
|
|
preference
|
|
q
|
|
routing
|
|
_source
|
|
_sourceExclude
|
|
_sourceInclude
|
|
id
|
|
index
|
|
type
|
|
client.fieldStats([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
fields
|
|
[level=cluster]
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
client.get([params, [callback]])
Get a typed JSON document from the index based on its id.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
/myindex/mytype/1
client.get({
index: 'myindex',
type: 'mytype',
id: 1
}, function (error, response) {
// ...
});
Params
fields
|
|
parent
|
|
preference
|
|
realtime
|
|
refresh
|
|
routing
|
|
_source
|
|
_sourceExclude
|
|
_sourceInclude
|
|
version
|
|
versionType
|
|
id
|
|
index
|
|
type
|
|
client.getScript([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
version
|
|
versionType
|
|
id
|
|
lang
|
|
client.getSource([params, [callback]])
Get the source of a document by its index, type and id.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
parent
|
|
preference
|
|
realtime
|
|
refresh
|
|
routing
|
|
_source
|
|
_sourceExclude
|
|
_sourceInclude
|
|
version
|
|
versionType
|
|
id
|
|
index
|
|
type
|
|
client.getTemplate([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
version
|
|
versionType
|
|
id
|
|
client.index([params, [callback]])
Stores a typed JSON document in an index, making it searchable. When the id
param is not set, a unique id will be auto-generated. When you specify an id
either a new document will be created, or an existing document will be updated. To enforce "put-if-absent" behavior set the opType
to "create"
or use the create()
method.
Optimistic concurrency control is performed, when the version
argument is specified. By default, no version checks are performed.
By default, the document will be available for get()
actions immediately, but will only be available for searching after an index refresh (which can happen automatically or manually). See [api-indices-refresh].
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.index({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
title: 'Test 1',
tags: ['y', 'z'],
published: true,
}
}, function (error, response) {
});
Params
consistency
|
|
parent
|
|
refresh
|
|
routing
|
|
timeout
|
|
timestamp
|
|
ttl
|
|
version
|
|
versionType
|
|
id
|
|
index
|
|
type
|
|
client.info([params, [callback]])
Get basic info from the current cluster.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.mget([params, [callback]])
Get multiple documents based on an index, type (optional) and ids. The body required by mget can take two forms: an array of document locations, or an array of document ids.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.mget({
body: {
docs: [
{ _index: 'indexA', _type: 'typeA', _id: '1' },
{ _index: 'indexB', _type: 'typeB', _id: '1' },
{ _index: 'indexC', _type: 'typeC', _id: '1' }
]
}
}, function(error, response){
// ...
});
index
and type
that apply to all of the ids.client.mget({
index: 'myindex',
type: 'mytype',
body: {
ids: [1, 2, 3]
}
}, function(error, response){
// ...
});
Params
fields
|
|
preference
|
|
realtime
|
|
refresh
|
|
_source
|
|
_sourceExclude
|
|
_sourceInclude
|
|
index
|
|
type
|
|
client.mpercolate([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
type
|
|
client.msearch([params, [callback]])
Execute several search requests within the same request.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.msearch({
body: [
// match all query, on all indices and types
{},
{ query: { match_all: {} } },
// query_string query, on index/mytype
{ _index: 'myindex', _type: 'mytype' },
{ query: { query_string: { query: '"Test 1"' } } }
]
});
Params
searchType
|
|
index
|
|
type
|
|
client.mtermvectors([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ids
|
|
termStatistics
|
|
[fieldStatistics=true]
|
|
fields
|
|
[offsets=true]
|
|
[positions=true]
|
|
[payloads=true]
|
|
preference
|
|
routing
|
|
parent
|
|
realtime
|
|
version
|
|
versionType
|
|
index
|
|
type
|
|
client.percolate([params, [callback]])
Match a document against registered percolator queries.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.index({
index: 'myindex',
type: '.percolator',
id: 'alert-1',
body: {
// This query will be run against documents sent to percolate
query: {
query_string: {
query: 'foo'
}
}
}
}, function (error, response) {
// ...
});
client.index({
index: 'myindex',
type: '.percolator',
id: 'alert-2',
body: {
// This query will also be run against documents sent to percolate
query: {
query_string: {
query: 'bar'
}
}
}
}, function (error, response) {
// ...
});
_percolator
queries they matchclient.percolate({
index: 'myindex',
type: 'mytype',
body: {
doc: {
title: "Foo"
}
}
}, function (error, response) {
// response would equal
// {
// total: 1,
// matches: [ { _index: 'myindex', _id: 'alert-1' } ]
// }
});
client.percolate({
index: 'myindex',
type: 'mytype',
body: {
doc: {
title: "Foo Bar"
}
}
}, function (error, response) {
// response would equal
// {
// total: 2,
// matches: [
// { _index: 'myindex', _id: 'alert-1' },
// { _index: 'myindex', _id: 'alert-2' }
// ]
// }
});
Params
routing
|
|
preference
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
percolateIndex
|
|
percolateType
|
|
percolateRouting
|
|
percolatePreference
|
|
percolateFormat
|
|
version
|
|
versionType
|
|
index
|
|
type
|
|
id
|
|
client.ping([params, [callback]])
The default method is HEAD
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.putScript([params, [callback]])
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
[opType=index]
|
|
version
|
|
versionType
|
|
id
|
|
lang
|
|
client.putTemplate([params, [callback]])
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
[opType=index]
|
|
version
|
|
versionType
|
|
id
|
|
client.renderSearchTemplate([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
id
|
|
client.scroll([params, [callback]])
Scroll a search request (retrieve the next set of results) after specifying the scroll parameter in a search()
call.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
var allTitles = [];
// first we do a search, and specify a scroll timeout
client.search({
index: 'myindex',
// Set to 30 seconds because we are calling right back
scroll: '30s',
search_type: 'scan',
fields: ['title'],
q: 'title:test'
}, function getMoreUntilDone(error, response) {
// collect the title from each response
response.hits.hits.forEach(function (hit) {
allTitles.push(hit.fields.title);
});
if (response.hits.total !== allTitles.length) {
// now we can call scroll over and over
client.scroll({
scrollId: response._scroll_id,
scroll: '30s'
}, getMoreUntilDone);
} else {
console.log('every "test" title', allTitles);
}
});
Params
scroll
|
|
scrollId
|
|
client.search([params, [callback]])
Return documents matching a query, aggregations/facets, highlighted snippets, suggestions, and more. Write your queries as either simple query strings in the q
parameter, or by specifying a full request definition using the Elasticsearch Query DSL in the body
parameter.
Tip
|
elastic.js, esq, or bodybuilder can be used to make building query bodies easier. |
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.search({
index: 'myindex',
q: 'title:test'
}, function (error, response) {
// ...
});
Hash
client.search({
index: 'myindex',
body: {
query: {
match: {
title: 'test'
}
},
facets: {
tags: {
terms: {
field: 'tags'
}
}
}
}
}, function (error, response) {
// ...
});
Params
analyzer
|
|
analyzeWildcard
|
|
[defaultOperator=OR]
|
|
df
|
|
explain
|
|
fields
|
|
fielddataFields
|
|
from
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
lenient
|
|
lowercaseExpandedTerms
|
|
preference
|
|
q
|
|
routing
|
|
scroll
|
|
searchType
|
|
size
|
|
sort
|
|
_source
|
|
_sourceExclude
|
|
_sourceInclude
|
|
terminateAfter
|
|
stats
|
|
suggestField
|
|
[suggestMode=missing]
|
|
suggestSize
|
|
suggestText
|
|
timeout
|
|
trackScores
|
|
version
|
|
requestCache
|
|
index
|
|
type
|
|
client.searchExists([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
minScore
|
|
preference
|
|
routing
|
|
q
|
|
analyzer
|
|
analyzeWildcard
|
|
[defaultOperator=OR]
|
|
df
|
|
lenient
|
|
lowercaseExpandedTerms
|
|
index
|
|
type
|
|
client.searchShards([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
preference
|
|
routing
|
|
local
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
type
|
|
client.searchTemplate([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
preference
|
|
routing
|
|
scroll
|
|
searchType
|
|
index
|
|
type
|
|
client.suggest([params, [callback]])
The suggest feature suggests similar looking terms based on a provided text by using a specific suggester.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.suggest({
index: 'myindex',
body: {
mysuggester: {
text: 'tset',
term: {
field: 'title'
}
}
}
}, function (error, response) {
// response will be formatted like so:
//
// {
// ...
// mysuggester: [
// {
// text: "tset",
// ...
// options: [
// {
// text: "test",
// score: 0.75,
// freq: 5
// }
// ]
// }
// ]
// }
});
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
preference
|
|
routing
|
|
index
|
|
client.termvectors([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
termStatistics
|
|
[fieldStatistics=true]
|
|
dfs
|
|
fields
|
|
[offsets=true]
|
|
[positions=true]
|
|
[payloads=true]
|
|
preference
|
|
routing
|
|
parent
|
|
realtime
|
|
version
|
|
versionType
|
|
index
|
|
type
|
|
id
|
|
client.update([params, [callback]])
Update parts of a document. The required body parameter can contain one of two things:
-
a partial document, which will be merged with the existing one.
-
a
script
which will update the document content
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.update({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
// put the partial document under the `doc` key
doc: {
title: 'Updated'
}
}
}, function (error, response) {
// ...
})
tags
property using a script
client.update({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
script: 'ctx._source.tags += tag',
params: { tag: 'some new tag' }
}
}, function (error, response) {
// ...
});
client.update({
index: 'myindex',
type: 'mytype',
id: '777',
body: {
script: 'ctx._source.counter += 1',
upsert: {
counter: 1
}
}
}, function (error, response) {
// ...
})
client.update({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
script: 'ctx._source.tags.contains(tag) ? ctx.op = "delete" : ctx.op = "none"',
params: {
tag: 'to-delete'
}
}
}, function (error, response) {
// ...
});
Params
consistency
|
|
fields
|
|
lang
|
|
parent
|
|
refresh
|
|
retryOnConflict
|
|
routing
|
|
script
|
|
scriptId
|
|
scriptedUpsert
|
|
timeout
|
|
timestamp
|
|
ttl
|
|
version
|
|
versionType
|
|
detectNoop
|
|
id
|
|
index
|
|
type
|
|
client.cat.aliases([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
name
|
|
client.cat.allocation([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
bytes
|
|
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
nodeId
|
|
client.cat.count([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
index
|
|
client.cat.fielddata([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
bytes
|
|
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
fields
|
|
client.cat.health([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
[ts=true]
|
|
v
|
|
client.cat.help([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
help
|
|
client.cat.indices([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
bytes
|
|
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
pri
|
|
v
|
|
index
|
|
client.cat.master([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
client.cat.nodeattrs([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
client.cat.nodes([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
client.cat.pendingTasks([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
client.cat.plugins([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
client.cat.recovery([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
bytes
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
index
|
|
client.cat.repositories([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
client.cat.segments([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
h
|
|
help
|
|
v
|
|
index
|
|
client.cat.shards([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
index
|
|
client.cat.snapshots([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
repository
|
|
client.cat.threadPool([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
h
|
|
help
|
|
v
|
|
fullId
|
|
client.cluster.getSettings([params, [callback]])
Get cluster settings (previously set with putSettings()
)
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flatSettings
|
|
masterTimeout
|
|
timeout
|
|
client.cluster.health([params, [callback]])
Get a very simple status on the health of the cluster.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
[level=cluster]
|
|
local
|
|
masterTimeout
|
|
timeout
|
|
waitForActiveShards
|
|
waitForNodes
|
|
waitForRelocatingShards
|
|
waitForStatus
|
|
index
|
|
client.cluster.pendingTasks([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
client.cluster.putSettings([params, [callback]])
Update cluster wide specific settings.
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flatSettings
|
|
masterTimeout
|
|
timeout
|
|
client.cluster.reroute([params, [callback]])
Explicitly execute a cluster reroute allocation command including specific commands.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
dryRun
|
|
explain
|
|
metric
|
|
masterTimeout
|
|
timeout
|
|
client.cluster.state([params, [callback]])
Get comprehensive details about the state of the whole cluster (indices settings, allocations, etc).
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
masterTimeout
|
|
flatSettings
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
metric
|
|
client.cluster.stats([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flatSettings
|
|
human
|
|
timeout
|
|
nodeId
|
|
client.indices.analyze([params, [callback]])
Perform the analysis process on a text and return the tokens breakdown of the text.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
analyzer
|
|
charFilters
|
|
field
|
|
filters
|
|
index
|
|
preferLocal
|
|
text
|
|
tokenizer
|
|
[format=detailed]
|
|
client.indices.clearCache([params, [callback]])
Clear either all caches or specific cached associated with one ore more indices.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
fieldData
|
|
fielddata
|
|
fields
|
|
query
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
recycler
|
|
request
|
|
client.indices.close([params, [callback]])
Close an index to remove its overhead from the cluster. Closed index is blocked for read/write operations.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
client.indices.create([params, [callback]])
Create an index in Elasticsearch.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
updateAllTypes
|
|
index
|
|
client.indices.delete([params, [callback]])
Delete an index in Elasticsearch
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
index
|
|
client.indices.deleteAlias([params, [callback]])
Delete a specific alias.
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
index
|
|
name
|
|
client.indices.deleteTemplate([params, [callback]])
Delete an index template by its name.
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
name
|
|
client.indices.deleteWarmer([params, [callback]])
Delete an index warmer.
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
name
|
|
index
|
|
client.indices.exists([params, [callback]])
Return a boolean indicating whether given index exists.
The default method is HEAD
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
local
|
|
index
|
|
client.indices.existsAlias([params, [callback]])
Return a boolean indicating whether given alias exists.
The default method is HEAD
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open,closed]
|
|
local
|
|
index
|
|
name
|
|
client.indices.existsTemplate([params, [callback]])
The default method is HEAD
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
local
|
|
name
|
|
client.indices.existsType([params, [callback]])
Check if a type/types exists in an index/indices.
The default method is HEAD
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
local
|
|
index
|
|
type
|
|
client.indices.flush([params, [callback]])
Explicitly flush one or more indices.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
force
|
|
waitIfOngoing
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
client.indices.flushSynced([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
index
|
|
client.indices.forcemerge([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flush
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
maxNumSegments
|
|
onlyExpungeDeletes
|
|
operationThreading
|
|
waitForMerge
|
|
index
|
|
client.indices.get([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
local
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
flatSettings
|
|
human
|
|
index
|
|
feature
|
|
client.indices.getAlias([params, [callback]])
Retrieve a specified alias.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
local
|
|
index
|
|
name
|
|
client.indices.getAliases([params, [callback]])
Retrieve specified aliases
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
local
|
|
index
|
|
name
|
|
client.indices.getFieldMapping([params, [callback]])
Retrieve mapping definition of a specific field.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
includeDefaults
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
local
|
|
index
|
|
type
|
|
fields
|
|
client.indices.getMapping([params, [callback]])
Retrieve mapping definition of index or index/type.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
local
|
|
index
|
|
type
|
|
client.indices.getSettings([params, [callback]])
Retrieve settings for one or more (or all) indices.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open,closed]
|
|
flatSettings
|
|
local
|
|
human
|
|
index
|
|
name
|
|
client.indices.getTemplate([params, [callback]])
Retrieve an index template by its name.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flatSettings
|
|
masterTimeout
|
|
local
|
|
name
|
|
client.indices.getUpgrade([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
human
|
|
index
|
|
client.indices.getWarmer([params, [callback]])
Retreieve an index warmer.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
local
|
|
index
|
|
name
|
|
type
|
|
client.indices.open([params, [callback]])
Open a closed index, making it available for search.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=closed]
|
|
index
|
|
client.indices.optimize([params, [callback]])
Explicitly optimize one or more indices.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flush
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
maxNumSegments
|
|
onlyExpungeDeletes
|
|
operationThreading
|
|
waitForMerge
|
|
index
|
|
client.indices.putAlias([params, [callback]])
Create an alias for a specific index/indices.
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
index
|
|
name
|
|
client.indices.putMapping([params, [callback]])
Register specific mapping definition for a specific type.
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
timeout
|
|
masterTimeout
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
updateAllTypes
|
|
index
|
|
type
|
|
client.indices.putSettings([params, [callback]])
Change specific index level settings in real time.
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
flatSettings
|
|
index
|
|
client.indices.putTemplate([params, [callback]])
Create an index template that will automatically be applied to new indices created.
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
order
|
|
create
|
|
timeout
|
|
masterTimeout
|
|
flatSettings
|
|
name
|
|
client.indices.putWarmer([params, [callback]])
Create an index warmer to run registered search requests to warm up the index before it is available for search.
The default method is PUT
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
requestCache
|
|
index
|
|
name
|
|
type
|
|
client.indices.recovery([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
detailed
|
|
activeOnly
|
|
human
|
|
index
|
|
client.indices.refresh([params, [callback]])
Explicitly refresh one or more index, making all operations performed since the last refresh available for search.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
force
|
|
operationThreading
|
|
index
|
|
client.indices.segments([params, [callback]])
Retrieve low level segments information that a Lucene index (shard level) is built with.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
human
|
|
operationThreading
|
|
verbose
|
|
index
|
|
client.indices.shardStores([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
status
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
operationThreading
|
|
index
|
|
client.indices.stats([params, [callback]])
Retrieve statistics on different operations happening on an index.
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
completionFields
|
|
fielddataFields
|
|
fields
|
|
groups
|
|
human
|
|
[level=indices]
|
|
types
|
|
index
|
|
metric
|
|
client.indices.updateAliases([params, [callback]])
Update specified aliases.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
client.indices.updateAliases({
body: {
actions: [
{ remove: { index: 'logstash-2014.04', alias: 'logstash-current' } },
{ add: { index: 'logstash-2014.05', alias: 'logstash-current' } }
]
}
}).then(function (response) {
// ...
}, errorHandler);
Params
timeout
|
|
masterTimeout
|
|
client.indices.upgrade([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
allowNoIndices
|
|
[expandWildcards=open]
|
|
ignoreUnavailable
|
|
waitForCompletion
|
|
onlyAncientSegments
|
|
index
|
|
client.indices.validateQuery([params, [callback]])
Validate a potentially expensive query without executing it.
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
explain
|
|
ignoreUnavailable
|
|
allowNoIndices
|
|
[expandWildcards=open]
|
|
operationThreading
|
|
q
|
|
analyzer
|
|
analyzeWildcard
|
|
[defaultOperator=OR]
|
|
df
|
|
lenient
|
|
lowercaseExpandedTerms
|
|
rewrite
|
|
index
|
|
type
|
|
client.nodes.hotThreads([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
interval
|
|
snapshots
|
|
threads
|
|
ignoreIdleThreads
|
|
type
|
|
timeout
|
|
nodeId
|
|
client.nodes.info([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
flatSettings
|
|
human
|
|
timeout
|
|
nodeId
|
|
metric
|
|
client.nodes.stats([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
completionFields
|
|
fielddataFields
|
|
fields
|
|
groups
|
|
human
|
|
[level=node]
|
|
types
|
|
timeout
|
|
metric
|
|
indexMetric
|
|
nodeId
|
|
client.snapshot.create([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
waitForCompletion
|
|
repository
|
|
snapshot
|
|
client.snapshot.createRepository([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
timeout
|
|
verify
|
|
repository
|
|
client.snapshot.delete([params, [callback]])
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
repository
|
|
snapshot
|
|
client.snapshot.deleteRepository([params, [callback]])
The default method is DELETE
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
timeout
|
|
repository
|
|
client.snapshot.get([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
repository
|
|
snapshot
|
|
client.snapshot.getRepository([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
local
|
|
repository
|
|
client.snapshot.restore([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
waitForCompletion
|
|
repository
|
|
snapshot
|
|
client.snapshot.status([params, [callback]])
The default method is GET
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
repository
|
|
snapshot
|
|
client.snapshot.verifyRepository([params, [callback]])
The default method is POST
and the usual params and return values apply. See the elasticsearch docs for more about this method.
Params
masterTimeout
|
|
timeout
|
|
repository
|
|