Changes the following example index names to `my-index-000001` for consistency: * `my-index` * `my_index` * `myindex`
This commit is contained in:
parent
3bb58eb5c1
commit
aba785cb6e
|
@ -69,7 +69,7 @@ index:: The name of an index containing a mapping that is compatible with the do
|
|||
|
||||
[source,console]
|
||||
----------------------------------------------------------------
|
||||
PUT /my-index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -90,7 +90,7 @@ POST /_scripts/painless/_execute
|
|||
},
|
||||
"context": "filter",
|
||||
"context_setup": {
|
||||
"index": "my-index",
|
||||
"index": "my-index-000001",
|
||||
"document": {
|
||||
"field": "four"
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ query:: If `_score` is used in the script then a query can specify that it will
|
|||
|
||||
[source,console]
|
||||
----------------------------------------------------------------
|
||||
PUT /my-index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -148,7 +148,7 @@ POST /_scripts/painless/_execute
|
|||
},
|
||||
"context": "score",
|
||||
"context_setup": {
|
||||
"index": "my-index",
|
||||
"index": "my-index-000001",
|
||||
"document": {
|
||||
"rank": 4
|
||||
}
|
||||
|
|
|
@ -348,7 +348,7 @@ Below is an example of how to set up a field for sorting German names in
|
|||
|
||||
[source,console]
|
||||
--------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -368,7 +368,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
GET /my_index/_search <3>
|
||||
GET /my-index-000001/_search <3>
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
|
|
|
@ -45,11 +45,11 @@ PUT _ingest/pipeline/attachment
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id?pipeline=attachment
|
||||
PUT my-index-00001/_doc/my_id?pipeline=attachment
|
||||
{
|
||||
"data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
|
||||
}
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-00001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
Returns this:
|
||||
|
@ -58,7 +58,7 @@ Returns this:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id",
|
||||
"_version": 1,
|
||||
|
@ -128,11 +128,11 @@ PUT _ingest/pipeline/attachment
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id?pipeline=attachment
|
||||
PUT my-index-00001/_doc/my_id?pipeline=attachment
|
||||
{
|
||||
"data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0="
|
||||
}
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-00001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
Returns this:
|
||||
|
@ -141,7 +141,7 @@ Returns this:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id",
|
||||
"_version": 1,
|
||||
|
@ -176,12 +176,12 @@ PUT _ingest/pipeline/attachment
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id_2?pipeline=attachment
|
||||
PUT my-index-00001/_doc/my_id_2?pipeline=attachment
|
||||
{
|
||||
"data": "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
|
||||
"max_size": 5
|
||||
}
|
||||
GET my_index/_doc/my_id_2
|
||||
GET my-index-00001/_doc/my_id_2
|
||||
--------------------------------------------------
|
||||
|
||||
Returns this:
|
||||
|
@ -190,7 +190,7 @@ Returns this:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id_2",
|
||||
"_version": 1,
|
||||
|
@ -262,7 +262,7 @@ PUT _ingest/pipeline/attachment
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id?pipeline=attachment
|
||||
PUT my-index-00001/_doc/my_id?pipeline=attachment
|
||||
{
|
||||
"attachments" : [
|
||||
{
|
||||
|
@ -275,7 +275,7 @@ PUT my_index/_doc/my_id?pipeline=attachment
|
|||
}
|
||||
]
|
||||
}
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-00001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
Returns this:
|
||||
|
@ -283,7 +283,7 @@ Returns this:
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"_index" : "my_index",
|
||||
"_index" : "my-index-00001",
|
||||
"_type" : "_doc",
|
||||
"_id" : "my_id",
|
||||
"_version" : 1,
|
||||
|
|
|
@ -24,7 +24,7 @@ the search index:
|
|||
|
||||
[source,console]
|
||||
--------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -47,7 +47,7 @@ in the search index:
|
|||
|
||||
[source,js]
|
||||
--------------------------
|
||||
GET my_index/_analyze
|
||||
GET my-index-000001/_analyze
|
||||
{
|
||||
"field": "my_field",
|
||||
"text":"Investors in [Apple](Apple+Inc.) rejoiced."
|
||||
|
@ -112,18 +112,18 @@ in this example where a search for `Beck` will not match `Jeff Beck` :
|
|||
[source,console]
|
||||
--------------------------
|
||||
# Example documents
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"my_field": "[Beck](Beck) announced a new tour"<1>
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"my_field": "[Jeff Beck](Jeff+Beck&Guitarist) plays a strat"<2>
|
||||
}
|
||||
|
||||
# Example search
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"term": {
|
||||
|
@ -164,7 +164,7 @@ sense to include them in dedicated structured fields to support discovery via ag
|
|||
|
||||
[source,console]
|
||||
--------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -189,13 +189,13 @@ Applications would then typically provide content and discover it as follows:
|
|||
[source,console]
|
||||
--------------------------
|
||||
# Example documents
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"my_unstructured_text_field": "[Shay](%40kimchy) created elasticsearch",
|
||||
"my_twitter_handles": ["@kimchy"] <1>
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"query_string": {
|
||||
|
@ -264,12 +264,12 @@ in a way which is respectful of the original markup:
|
|||
[source,console]
|
||||
--------------------------
|
||||
# Example documents
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"my_field": "The cat sat on the [mat](sku3578)"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"query_string": {
|
||||
|
|
|
@ -16,7 +16,7 @@ value and its hash are stored in the index:
|
|||
|
||||
[source,console]
|
||||
--------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -40,17 +40,17 @@ of the values of the `my_field` field. This is only useful in order to run
|
|||
[source,console]
|
||||
--------------------------
|
||||
# Example documents
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"my_field": "This is a document"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"my_field": "This is another document"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"aggs": {
|
||||
"my_field_cardinality": {
|
||||
|
|
|
@ -15,7 +15,7 @@ In order to enable the `_size` field, set the mapping as follows:
|
|||
|
||||
[source,console]
|
||||
--------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"_size": {
|
||||
|
@ -31,17 +31,17 @@ and when sorting:
|
|||
[source,console]
|
||||
--------------------------
|
||||
# Example documents
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"text": "This is a document"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"text": "This is another document"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"range": {
|
||||
|
|
|
@ -46,7 +46,7 @@ It can also be set on a per-index basis at index creation time:
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.store.type": "smb_mmap_fs"
|
||||
|
|
|
@ -78,11 +78,11 @@ Simple use-case:
|
|||
>>> es = Elasticsearch()
|
||||
|
||||
# datetimes will be serialized
|
||||
>>> es.index(index="my-index", doc_type="test-type", id=42, body={"any": "data", "timestamp": datetime.now()})
|
||||
{u'_id': u'42', u'_index': u'my-index', u'_type': u'test-type', u'_version': 1, u'ok': True}
|
||||
>>> es.index(index="my-index-000001", doc_type="test-type", id=42, body={"any": "data", "timestamp": datetime.now()})
|
||||
{u'_id': u'42', u'_index': u'my-index-000001', u'_type': u'test-type', u'_version': 1, u'ok': True}
|
||||
|
||||
# but not deserialized
|
||||
>>> es.get(index="my-index", doc_type="test-type", id=42)['_source']
|
||||
>>> es.get(index="my-index-000001", doc_type="test-type", id=42)['_source']
|
||||
{u'any': u'data', u'timestamp': u'2013-05-12T19:45:31.804229'}
|
||||
------------------------------------
|
||||
|
||||
|
|
|
@ -119,22 +119,22 @@ Consider the following example:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
PUT my_index/log/1?refresh
|
||||
PUT my-index-00001/log/1?refresh
|
||||
{
|
||||
"date": "2015-10-01T00:30:00Z"
|
||||
}
|
||||
|
||||
PUT my_index/log/2?refresh
|
||||
PUT my-index-00001/log/2?refresh
|
||||
{
|
||||
"date": "2015-10-01T01:30:00Z"
|
||||
}
|
||||
|
||||
PUT my_index/log/3?refresh
|
||||
PUT my-index-00001/log/3?refresh
|
||||
{
|
||||
"date": "2015-10-01T02:30:00Z"
|
||||
}
|
||||
|
||||
GET my_index/_search?size=0
|
||||
GET my-index-00001/_search?size=0
|
||||
{
|
||||
"aggs": {
|
||||
"by_day": {
|
||||
|
@ -185,7 +185,7 @@ midnight UTC:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
GET my_index/_search?size=0
|
||||
GET my-index-00001/_search?size=0
|
||||
{
|
||||
"aggs": {
|
||||
"by_day": {
|
||||
|
|
|
@ -293,17 +293,17 @@ include::datehistogram-aggregation.asciidoc[tag=offset-explanation]
|
|||
|
||||
[source,console,id=composite-aggregation-datehistogram-offset-example]
|
||||
----
|
||||
PUT my_index/_doc/1?refresh
|
||||
PUT my-index-000001/_doc/1?refresh
|
||||
{
|
||||
"date": "2015-10-01T05:30:00Z"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2?refresh
|
||||
PUT my-index-000001/_doc/2?refresh
|
||||
{
|
||||
"date": "2015-10-01T06:30:00Z"
|
||||
}
|
||||
|
||||
GET my_index/_search?size=0
|
||||
GET my-index-000001/_search?size=0
|
||||
{
|
||||
"aggs": {
|
||||
"my_buckets": {
|
||||
|
|
|
@ -378,17 +378,17 @@ Consider the following example:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
PUT my_index/_doc/1?refresh
|
||||
PUT my-index-000001/_doc/1?refresh
|
||||
{
|
||||
"date": "2015-10-01T00:30:00Z"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2?refresh
|
||||
PUT my-index-000001/_doc/2?refresh
|
||||
{
|
||||
"date": "2015-10-01T01:30:00Z"
|
||||
}
|
||||
|
||||
GET my_index/_search?size=0
|
||||
GET my-index-000001/_search?size=0
|
||||
{
|
||||
"aggs": {
|
||||
"by_day": {
|
||||
|
@ -429,7 +429,7 @@ before midnight UTC:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
GET my_index/_search?size=0
|
||||
GET my-index-000001/_search?size=0
|
||||
{
|
||||
"aggs": {
|
||||
"by_day": {
|
||||
|
@ -500,17 +500,17 @@ to run from 6am to 6am:
|
|||
|
||||
[source,console]
|
||||
-----------------------------
|
||||
PUT my_index/_doc/1?refresh
|
||||
PUT my-index-000001/_doc/1?refresh
|
||||
{
|
||||
"date": "2015-10-01T05:30:00Z"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2?refresh
|
||||
PUT my-index-000001/_doc/2?refresh
|
||||
{
|
||||
"date": "2015-10-01T06:30:00Z"
|
||||
}
|
||||
|
||||
GET my_index/_search?size=0
|
||||
GET my-index-000001/_search?size=0
|
||||
{
|
||||
"aggs": {
|
||||
"by_day": {
|
||||
|
|
|
@ -8,7 +8,7 @@ to support a list of stop words:
|
|||
|
||||
[source,console]
|
||||
--------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -36,13 +36,13 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"field": "my_text", <2>
|
||||
"text": "The old brown cow"
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"field": "my_text.english", <3>
|
||||
"text": "The old brown cow"
|
||||
|
|
|
@ -53,7 +53,7 @@ Token Filters::
|
|||
|
||||
[source,console]
|
||||
--------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -74,7 +74,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_custom_analyzer",
|
||||
"text": "Is this <b>déjà vu</b>?"
|
||||
|
@ -155,7 +155,7 @@ Here is an example:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -197,7 +197,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_custom_analyzer",
|
||||
"text": "I'm a :) person, and you?"
|
||||
|
|
|
@ -87,7 +87,7 @@ pre-defined list of English stop words:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -101,7 +101,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_fingerprint_analyzer",
|
||||
"text": "Yes yes, Gödel said this sentence is consistent and."
|
||||
|
|
|
@ -178,7 +178,7 @@ on non-word characters or on underscores (`\W|_`), and to lower-case the result:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -193,7 +193,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_email_analyzer",
|
||||
"text": "John_Smith@foo-bar.com"
|
||||
|
@ -265,7 +265,7 @@ The following more complicated example splits CamelCase text into tokens:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -279,7 +279,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
GET my_index/_analyze
|
||||
GET my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "camel",
|
||||
"text": "MooseX::FTPClass2_beta"
|
||||
|
|
|
@ -132,7 +132,7 @@ adding token filters.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -152,7 +152,7 @@ pre-defined list of English stop words:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -167,7 +167,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_english_analyzer",
|
||||
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
|
||||
|
|
|
@ -131,7 +131,7 @@ words as stop words:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -145,7 +145,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_stop_analyzer",
|
||||
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
|
||||
|
|
|
@ -62,7 +62,7 @@ The following <<indices-create-index,create index API>> request uses the
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -104,7 +104,7 @@ HTML element.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -107,7 +107,7 @@ with a text equivalent.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -139,7 +139,7 @@ the text `I'm delighted about it :(`.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_analyze
|
||||
GET /my-index-000001/_analyze
|
||||
{
|
||||
"tokenizer": "keyword",
|
||||
"char_filter": [ "my_mappings_char_filter" ],
|
||||
|
|
|
@ -52,7 +52,7 @@ replace any embedded dashes in numbers with underscores, i.e `123-456-789` ->
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-00001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -75,7 +75,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-00001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "My credit card is 123-456-789"
|
||||
|
@ -102,7 +102,7 @@ camelCase words to be queried individually:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-00001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -136,7 +136,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-00001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "The fooBarBaz method"
|
||||
|
@ -203,12 +203,12 @@ the length of the original text:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index/_doc/1?refresh
|
||||
PUT my-index-00001/_doc/1?refresh
|
||||
{
|
||||
"text": "The fooBarBaz method"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-00001/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
|
@ -245,7 +245,7 @@ The output from the above is:
|
|||
"max_score": 0.2876821,
|
||||
"hits": [
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_score": 0.2876821,
|
||||
|
|
|
@ -48,7 +48,7 @@ The following <<indices-create-index,create index API>> request sets the
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -68,11 +68,11 @@ In addition to a field-level analyzer, you can set a fallback analyzer for
|
|||
using the `analysis.analyzer.default` setting.
|
||||
|
||||
The following <<indices-create-index,create index API>> request sets the
|
||||
`simple` analyzer as the fallback analyzer for `my_index`.
|
||||
`simple` analyzer as the fallback analyzer for `my-index-000001`.
|
||||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -128,7 +128,7 @@ the search analyzer for a <<query-dsl-match-query,`match`>> query.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
|
@ -140,7 +140,7 @@ GET my_index/_search
|
|||
}
|
||||
}
|
||||
----
|
||||
// TEST[s/^/PUT my_index\n/]
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
|
||||
[[specify-search-field-analyzer]]
|
||||
==== Specify the search analyzer for a field
|
||||
|
@ -156,7 +156,7 @@ The following <<indices-create-index,create index API>> request sets the
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -180,11 +180,11 @@ If a search analyzer is provided, a default index analyzer must also be
|
|||
specified using the `analysis.analyzer.default` setting.
|
||||
|
||||
The following <<indices-create-index,create index API>> request sets the
|
||||
`whitespace` analyzer as the default search analyzer for the `my_index` index.
|
||||
`whitespace` analyzer as the default search analyzer for the `my-index-000001` index.
|
||||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -123,7 +123,7 @@ referred to when running the `analyze` API on a specific index:
|
|||
|
||||
[source,console]
|
||||
-------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -149,13 +149,13 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
GET my_index/_analyze <3>
|
||||
GET my-index-000001/_analyze <3>
|
||||
{
|
||||
"analyzer": "std_folded", <4>
|
||||
"text": "Is this déjà vu?"
|
||||
}
|
||||
|
||||
GET my_index/_analyze <3>
|
||||
GET my-index-000001/_analyze <3>
|
||||
{
|
||||
"field": "my_text", <5>
|
||||
"text": "Is this déjà vu?"
|
||||
|
|
|
@ -201,7 +201,7 @@ these token graphs, making them suitable for indexing.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -201,7 +201,7 @@ output.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -363,7 +363,7 @@ not stem these tokens.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -382,7 +382,7 @@ create a stemmed and unstemmed version of each token in a stream. The
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -96,7 +96,7 @@ before the `kstem` filter in the analyzer configuration.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -132,7 +132,7 @@ The request also assigns the custom analyzer to the `fingerprint` field mapping.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -134,7 +134,7 @@ removed.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -95,7 +95,7 @@ filter before the `porter_stem` filter in the analyzer configuration.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -100,7 +100,7 @@ The `my_script_filter` filter removes tokens with of any type other than
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -134,7 +134,7 @@ filter then removes any duplicate tokens in the same position.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -296,7 +296,7 @@ analyzer>>.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -486,7 +486,7 @@ only shingles are included in the output.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -15,7 +15,7 @@ For example:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -23,7 +23,7 @@ Here is an example:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -55,7 +55,7 @@ You can also define the overrides rules inline:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -83,7 +83,7 @@ analyzer>>.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -256,7 +256,7 @@ words using the `light_german` algorithm:
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -104,7 +104,7 @@ filter to configure a new <<analysis-custom-analyzer,custom analyzer>>.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -181,7 +181,7 @@ words list:
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -208,7 +208,7 @@ words `and`, `is`, and `the`:
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -135,7 +135,7 @@ The following <<indices-create-index,create index API>> request uses the
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -408,7 +408,7 @@ filter that uses the following rules:
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -146,7 +146,7 @@ The following <<indices-create-index,create index API>> request uses the
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -357,7 +357,7 @@ filter that uses the following rules:
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
|
|
@ -146,7 +146,7 @@ In this example, we configure the `classic` tokenizer to have a
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -165,7 +165,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
|
||||
|
|
|
@ -142,7 +142,7 @@ length `10`:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-00001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -166,7 +166,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-00001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "2 Quick Foxes."
|
||||
|
@ -262,7 +262,7 @@ search terms longer than 10 characters may not match any indexed terms.
|
|||
|
||||
[source,console]
|
||||
-----------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-00001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -300,14 +300,14 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-00001/_doc/1
|
||||
{
|
||||
"title": "Quick Foxes" <1>
|
||||
}
|
||||
|
||||
POST my_index/_refresh
|
||||
POST my-index-00001/_refresh
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-00001/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
|
@ -344,7 +344,7 @@ GET my_index/_search
|
|||
"max_score": 0.5753642,
|
||||
"hits": [
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_score": 0.5753642,
|
||||
|
|
|
@ -218,7 +218,7 @@ digits as tokens, and to produce tri-grams (grams of length `3`):
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -242,7 +242,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "2 Quick Foxes."
|
||||
|
|
|
@ -94,7 +94,7 @@ characters, and to replace them with `/`. The first two tokens are skipped:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -115,7 +115,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "one-two-three-four-five"
|
||||
|
|
|
@ -126,7 +126,7 @@ tokens when it encounters commas:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -145,7 +145,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "comma,separated,values"
|
||||
|
@ -214,7 +214,7 @@ escaped, so the pattern ends up looking like:
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -234,7 +234,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "\"value\", \"value with embedded \\\" quote\""
|
||||
|
|
|
@ -37,7 +37,7 @@ three-digit numbers
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -56,7 +56,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "fd-786-335-514-x"
|
||||
|
|
|
@ -38,7 +38,7 @@ text on underscores.
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -57,7 +57,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "an_underscored_phrase"
|
||||
|
|
|
@ -137,7 +137,7 @@ In this example, we configure the `standard` tokenizer to have a
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -156,7 +156,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
|
||||
|
|
|
@ -93,7 +93,7 @@ In this example, we configure the `uax_url_email` tokenizer to have a
|
|||
|
||||
[source,console]
|
||||
----------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"analysis": {
|
||||
|
@ -112,7 +112,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
POST my_index/_analyze
|
||||
POST my-index-000001/_analyze
|
||||
{
|
||||
"analyzer": "my_analyzer",
|
||||
"text": "john.smith@global-international.com"
|
||||
|
|
|
@ -68,7 +68,7 @@ it finds by sending an empty body for the request.
|
|||
//////
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /myindex
|
||||
PUT /my-index-000001
|
||||
--------------------------------------------------
|
||||
// TESTSETUP
|
||||
//////
|
||||
|
@ -77,7 +77,7 @@ PUT /myindex
|
|||
--------------------------------------------------
|
||||
GET /_cluster/allocation/explain
|
||||
{
|
||||
"index": "myindex",
|
||||
"index": "my-index-000001",
|
||||
"shard": 0,
|
||||
"primary": true
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ GET /_cluster/allocation/explain
|
|||
--------------------------------------------------
|
||||
GET /_cluster/allocation/explain
|
||||
{
|
||||
"index": "myindex",
|
||||
"index": "my-index-000001",
|
||||
"shard": 0,
|
||||
"primary": false,
|
||||
"current_node": "nodeA" <1>
|
||||
|
@ -106,22 +106,23 @@ GET /_cluster/allocation/explain
|
|||
//////
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
DELETE myindex
|
||||
DELETE my-index-000001
|
||||
--------------------------------------------------
|
||||
//////
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /my_index?master_timeout=1s&timeout=1s
|
||||
PUT /my-index-000001?master_timeout=1s&timeout=1s
|
||||
{"settings": {"index.routing.allocation.include._name": "non_existent_node"} }
|
||||
|
||||
GET /_cluster/allocation/explain
|
||||
{
|
||||
"index": "my_index",
|
||||
"index": "my-index-000001",
|
||||
"shard": 0,
|
||||
"primary": true
|
||||
}
|
||||
--------------------------------------------------
|
||||
// TEST[continued]
|
||||
|
||||
|
||||
The API returns the following response for an unassigned primary shard:
|
||||
|
@ -129,7 +130,7 @@ The API returns the following response for an unassigned primary shard:
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"index" : "my_index",
|
||||
"index" : "my-index-000001",
|
||||
"shard" : 0,
|
||||
"primary" : true,
|
||||
"current_state" : "unassigned", <1>
|
||||
|
@ -178,7 +179,7 @@ allocated to a node in the cluster:
|
|||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"index" : "my_index",
|
||||
"index" : "my-index-000001",
|
||||
"shard" : 0,
|
||||
"primary" : true,
|
||||
"current_state" : "unassigned",
|
||||
|
@ -203,7 +204,7 @@ allocation:
|
|||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"index" : "my_index",
|
||||
"index" : "my-index-000001",
|
||||
"shard" : 0,
|
||||
"primary" : false,
|
||||
"current_state" : "unassigned",
|
||||
|
@ -239,7 +240,7 @@ allocation:
|
|||
{
|
||||
"decider" : "same_shard",
|
||||
"decision" : "NO",
|
||||
"explanation" : "a copy of this shard is already allocated to this node [[my_index][0], node[3sULLVJrRneSg0EfBB-2Ew], [P], s[STARTED], a[id=eV9P8BN1QPqRc3B4PLx6cg]]"
|
||||
"explanation" : "a copy of this shard is already allocated to this node [[my-index-000001][0], node[3sULLVJrRneSg0EfBB-2Ew], [P], s[STARTED], a[id=eV9P8BN1QPqRc3B4PLx6cg]]"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -260,7 +261,7 @@ its current node and is required to move:
|
|||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"index" : "my_index",
|
||||
"index" : "my-index-000001",
|
||||
"shard" : 0,
|
||||
"primary" : true,
|
||||
"current_state" : "started",
|
||||
|
@ -309,7 +310,7 @@ because moving the shard to another node does not form a better cluster balance:
|
|||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"index" : "my_index",
|
||||
"index" : "my-index-000001",
|
||||
"shard" : 0,
|
||||
"primary" : true,
|
||||
"current_state" : "started",
|
||||
|
|
|
@ -17,7 +17,7 @@ event.
|
|||
////
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index/_bulk?refresh
|
||||
PUT /my-index-00001/_bulk?refresh
|
||||
{"index":{ }}
|
||||
{ "@timestamp": "2020-12-06T11:04:05.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process", "id": "edwCRnyD", "sequence": 1 }, "process": { "name": "cmd.exe", "executable": "C:\\Windows\\System32\\cmd.exe" } }
|
||||
{"index":{ }}
|
||||
|
@ -36,7 +36,7 @@ PUT /my_index/_bulk?refresh
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_eql/search
|
||||
GET /my-index-00001/_eql/search
|
||||
{
|
||||
"query": """
|
||||
process where process.name = "regsvr32.exe"
|
||||
|
@ -510,7 +510,7 @@ The following EQL search request searches for events with an `event.category` of
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_eql/search
|
||||
GET /my-index-00001/_eql/search
|
||||
{
|
||||
"query": """
|
||||
file where (file.name == "cmd.exe" and agent.id != "my_user")
|
||||
|
@ -542,7 +542,7 @@ the events in ascending, lexicographic order.
|
|||
},
|
||||
"events": [
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "fwGeywNsBl8Y9Ys1x51b",
|
||||
"_score": null,
|
||||
|
@ -570,7 +570,7 @@ the events in ascending, lexicographic order.
|
|||
}
|
||||
},
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "AtOJ4UjUBAAx3XR5kcCM",
|
||||
"_score": null,
|
||||
|
@ -629,7 +629,7 @@ These events must also share the same `agent.id` value.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_eql/search
|
||||
GET /my-index-00001/_eql/search
|
||||
{
|
||||
"query": """
|
||||
sequence by agent.id
|
||||
|
@ -668,7 +668,7 @@ the events in ascending, lexicographic order.
|
|||
],
|
||||
"events": [
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "AtOJ4UjUBAAx3XR5kcCM",
|
||||
"_version": 1,
|
||||
|
@ -699,7 +699,7 @@ the events in ascending, lexicographic order.
|
|||
}
|
||||
},
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "yDwnGIJouOYGBzP0ZE9n",
|
||||
"_version": 1,
|
||||
|
|
|
@ -19,16 +19,16 @@ When targeting a data stream, the new index becomes the data stream's
|
|||
To roll over an <<indices-aliases, index alias>>, the alias and its write index
|
||||
must meet the following conditions:
|
||||
|
||||
* The index name must match the pattern '^.*-\\d+$', for example (`my_index-000001`).
|
||||
* The index name must match the pattern '^.*-\\d+$', for example (`my-index-000001`).
|
||||
* The `index.lifecycle.rollover_alias` must be configured as the alias to roll over.
|
||||
* The index must be the <<indices-rollover-is-write-index, write index>> for the alias.
|
||||
|
||||
For example, if `my_index-000001` has the alias `my_data`,
|
||||
For example, if `my-index-000001` has the alias `my_data`,
|
||||
the following settings must be configured.
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index-000001
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.lifecycle.name": "my_policy",
|
||||
|
|
|
@ -57,7 +57,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|||
[[ilm-explain-lifecycle-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following example retrieves the lifecycle state of `my_index`:
|
||||
The following example retrieves the lifecycle state of `my-index-000001`:
|
||||
|
||||
//////////////////////////
|
||||
|
||||
|
@ -85,7 +85,7 @@ PUT _ilm/policy/my_policy
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.lifecycle.name": "my_policy",
|
||||
|
@ -101,7 +101,7 @@ GET /_cluster/health?wait_for_status=green&timeout=10s
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
GET my_index/_ilm/explain
|
||||
GET my-index-000001/_ilm/explain
|
||||
--------------------------------------------------
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -112,8 +112,8 @@ that the index is managed and in the `new` phase:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"indices": {
|
||||
"my_index": {
|
||||
"index": "my_index",
|
||||
"my-index-000001": {
|
||||
"index": "my-index-000001",
|
||||
"managed": true, <1>
|
||||
"policy": "my_policy", <2>
|
||||
"lifecycle_date_millis": 1538475653281, <3>
|
||||
|
|
|
@ -102,7 +102,7 @@ The name of the step to move to and execute.
|
|||
[[ilm-move-to-step-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following example moves `my_index` from the initial step to the
|
||||
The following example moves `my-index-000001` from the initial step to the
|
||||
`forcemerge` step:
|
||||
|
||||
//////////////////////////
|
||||
|
@ -131,7 +131,7 @@ PUT _ilm/policy/my_policy
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.lifecycle.name": "my_policy"
|
||||
|
@ -143,7 +143,7 @@ PUT my_index
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST _ilm/move/my_index
|
||||
POST _ilm/move/my-index-000001
|
||||
{
|
||||
"current_step": { <1>
|
||||
"phase": "new",
|
||||
|
|
|
@ -48,7 +48,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|||
[[ilm-remove-policy-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following example removes the assigned policy from `my_index`.
|
||||
The following example removes the assigned policy from `my-index-000001`.
|
||||
|
||||
//////////////////////////
|
||||
|
||||
|
@ -76,7 +76,7 @@ PUT _ilm/policy/my_policy
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.lifecycle.name": "my_policy"
|
||||
|
@ -88,7 +88,7 @@ PUT my_index
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST my_index/_ilm/remove
|
||||
POST my-index-000001/_ilm/remove
|
||||
--------------------------------------------------
|
||||
// TEST[continued]
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|||
[[ilm-retry-policy-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following example retries the policy for `my_index`.
|
||||
The following example retries the policy for `my-index-000001`.
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
POST my_index/_ilm/retry
|
||||
POST my-index-000001/_ilm/retry
|
||||
--------------------------------------------------
|
||||
// NOTCONSOLE
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ PUT _ilm/policy/my_policy
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
|
||||
POST _ilm/stop
|
||||
--------------------------------------------------
|
||||
|
|
|
@ -70,7 +70,7 @@ PUT _ilm/policy/my_policy
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
--------------------------------------------------
|
||||
// TEST
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ index that has only two shards:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /myindex
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.number_of_shards": 2,
|
||||
|
@ -47,16 +47,16 @@ PUT /myindex
|
|||
--------------------------------------------------
|
||||
// TEST[continued]
|
||||
|
||||
After five days, {ilm-init} attempts to shrink `myindex` from two shards to four shards.
|
||||
After five days, {ilm-init} attempts to shrink `my-index-000001` from two shards to four shards.
|
||||
Because the shrink action cannot _increase_ the number of shards, this operation fails
|
||||
and {ilm-init} moves `myindex` to the `ERROR` step.
|
||||
and {ilm-init} moves `my-index-000001` to the `ERROR` step.
|
||||
|
||||
You can use the <<ilm-explain-lifecycle,{ilm-init} Explain API>> to get information about
|
||||
what went wrong:
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
GET /myindex/_ilm/explain
|
||||
GET /my-index-000001/_ilm/explain
|
||||
--------------------------------------------------
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -66,8 +66,8 @@ Which returns the following information:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"indices" : {
|
||||
"myindex" : {
|
||||
"index" : "myindex",
|
||||
"my-index-000001" : {
|
||||
"index" : "my-index-000001",
|
||||
"managed" : true,
|
||||
"policy" : "shrink-index", <1>
|
||||
"lifecycle_date_millis" : 1541717265865,
|
||||
|
@ -141,7 +141,7 @@ you might need to explicitly tell {ilm-init} to retry the step:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /myindex/_ilm/retry
|
||||
POST /my-index-000001/_ilm/retry
|
||||
--------------------------------------------------
|
||||
// TEST[skip:we can't be sure the index is ready to be retried at this point]
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ PUT _ilm/policy/my_policy
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.lifecycle.name": "my_policy"
|
||||
|
|
|
@ -141,9 +141,9 @@ The following example shows how to add an index block:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /my_index/_block/write
|
||||
PUT /my-index-000001/_block/write
|
||||
--------------------------------------------------
|
||||
// TEST[s/^/PUT my_index\n/]
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
|
||||
The API returns following response:
|
||||
|
||||
|
@ -153,7 +153,7 @@ The API returns following response:
|
|||
"acknowledged" : true,
|
||||
"shards_acknowledged" : true,
|
||||
"indices" : [ {
|
||||
"name" : "my_index",
|
||||
"name" : "my-index-000001",
|
||||
"blocked" : true
|
||||
} ]
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ creation time:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.store.type": "hybridfs"
|
||||
|
@ -118,7 +118,7 @@ or in the index settings at index creation time:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.store.preload": ["nvd", "dvd"]
|
||||
|
|
|
@ -47,8 +47,8 @@ The following example freezes and unfreezes an index:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /my_index/_freeze
|
||||
POST /my_index/_unfreeze
|
||||
POST /my-index-000001/_freeze
|
||||
POST /my-index-000001/_unfreeze
|
||||
--------------------------------------------------
|
||||
// TEST[s/^/PUT my_index\n/]
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ NOTE: Using the following analyzer as an index analyzer results in an error.
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index": {
|
||||
|
@ -144,7 +144,7 @@ and pick up the file changes.
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /my_index/_reload_search_analyzers
|
||||
POST /my-index-000001/_reload_search_analyzers
|
||||
--------------------------------------------------
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -160,7 +160,7 @@ The API returns the following response.
|
|||
},
|
||||
"reload_details": [
|
||||
{
|
||||
"index": "my_index",
|
||||
"index": "my-index-000001",
|
||||
"reloaded_analyzers": [
|
||||
"my_synonyms"
|
||||
],
|
||||
|
|
|
@ -40,7 +40,7 @@ The following example freezes and unfreezes an index:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /my_index/_freeze
|
||||
POST /my_index/_unfreeze
|
||||
POST /my-index-000001/_freeze
|
||||
POST /my-index-000001/_unfreeze
|
||||
--------------------------------------------------
|
||||
// TEST[s/^/PUT my_index\n/]
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
|
|
|
@ -64,9 +64,9 @@ The following example shows how to close an index:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /my_index/_close
|
||||
POST /my-index-000001/_close
|
||||
--------------------------------------------------
|
||||
// TEST[s/^/PUT my_index\n/]
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
|
||||
The API returns following response:
|
||||
|
||||
|
@ -76,7 +76,7 @@ The API returns following response:
|
|||
"acknowledged": true,
|
||||
"shards_acknowledged": true,
|
||||
"indices": {
|
||||
"my_index": {
|
||||
"my-index-000001": {
|
||||
"closed": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,13 +116,13 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|||
[[open-index-api-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following request re-opens a closed index named `my_index`.
|
||||
The following request re-opens a closed index named `my-index-000001`.
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /my_index/_open
|
||||
POST /my-index-000001/_open
|
||||
--------------------------------------------------
|
||||
// TEST[s/^/PUT my_index\nPOST my_index\/_close\n/]
|
||||
// TEST[s/^/PUT my-index-000001\nPOST my-index-000001\/_close\n/]
|
||||
|
||||
The API returns the following response:
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ replace the template without specifying one.
|
|||
--------------------------------------------------
|
||||
PUT /_template/template_1
|
||||
{
|
||||
"index_patterns" : ["myindex-*"],
|
||||
"index_patterns" : ["my-index-*"],
|
||||
"order" : 0,
|
||||
"settings" : {
|
||||
"number_of_shards" : 1
|
||||
|
|
|
@ -155,7 +155,7 @@ and an inner `first` text field.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -177,7 +177,7 @@ to the `name` field.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index/_mapping
|
||||
PUT /my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"name": {
|
||||
|
@ -197,7 +197,7 @@ to verify your changes.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_mapping
|
||||
GET /my-index-000001/_mapping
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -206,7 +206,7 @@ The API returns the following response:
|
|||
[source,console-result]
|
||||
----
|
||||
{
|
||||
"my_index" : {
|
||||
"my-index-000001" : {
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"name" : {
|
||||
|
@ -245,7 +245,7 @@ with the `city` <<text,text>> field.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -268,7 +268,7 @@ which can be used for sorting.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index/_mapping
|
||||
PUT /my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"city": {
|
||||
|
@ -289,7 +289,7 @@ to verify your changes.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_mapping
|
||||
GET /my-index-000001/_mapping
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -298,7 +298,7 @@ The API returns the following response:
|
|||
[source,console-result]
|
||||
----
|
||||
{
|
||||
"my_index" : {
|
||||
"my-index-000001" : {
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"city" : {
|
||||
|
@ -338,7 +338,7 @@ of `20`.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -357,7 +357,7 @@ to `100`.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index/_mapping
|
||||
PUT /my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"user_id": {
|
||||
|
@ -374,7 +374,7 @@ to verify your changes.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_mapping
|
||||
GET /my-index-000001/_mapping
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -383,7 +383,7 @@ The API returns the following response:
|
|||
[source,console-result]
|
||||
----
|
||||
{
|
||||
"my_index" : {
|
||||
"my-index-000001" : {
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"user_id" : {
|
||||
|
@ -533,7 +533,7 @@ with the `user_identifier` field.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -550,7 +550,7 @@ for the existing `user_identifier` field.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index/_mapping
|
||||
PUT /my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"user_id": {
|
||||
|
@ -567,7 +567,7 @@ to verify your changes.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_mapping
|
||||
GET /my-index-000001/_mapping
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -576,7 +576,7 @@ The API returns the following response:
|
|||
[source,console-result]
|
||||
----
|
||||
{
|
||||
"my_index" : {
|
||||
"my-index-000001" : {
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"user_id" : {
|
||||
|
|
|
@ -21,11 +21,11 @@ PUT /freeze-index
|
|||
|
||||
POST /freeze-index/_freeze
|
||||
|
||||
PUT /my-index
|
||||
PUT /my-index-000001
|
||||
|
||||
PUT /freeze-index/_alias/f-alias
|
||||
|
||||
PUT /my-index/_alias/f-alias
|
||||
PUT /my-index-000001/_alias/f-alias
|
||||
|
||||
PUT /_index_template/foo_data_stream
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ The API returns the following response:
|
|||
"name": "f-alias",
|
||||
"indices": [
|
||||
"freeze-index",
|
||||
"my-index"
|
||||
"my-index-000001"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
@ -139,34 +139,34 @@ for assigned primary and replica shards.
|
|||
GET /_shard_stores?status=green
|
||||
--------------------------------------------------
|
||||
// TEST[setup:node]
|
||||
// TEST[s/^/PUT my-index\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST my-index\/test\?refresh\n{"test": "test"}\n/]
|
||||
// TEST[s/^/PUT my-index-00001\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST my-index-00001\/test\?refresh\n{"test": "test"}\n/]
|
||||
|
||||
The API returns the following response:
|
||||
|
||||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"indices": {
|
||||
"my-index": {
|
||||
"shards": {
|
||||
"0": { <1>
|
||||
"stores": [ <2>
|
||||
{
|
||||
"sPa3OgxLSYGvQ4oPs-Tajw": { <3>
|
||||
"name": "node_t0",
|
||||
"ephemeral_id" : "9NlXRFGCT1m8tkvYCMK-8A",
|
||||
"transport_address": "local[1]",
|
||||
"attributes": {}
|
||||
},
|
||||
"allocation_id": "2iNySv_OQVePRX-yaRH_lQ", <4>
|
||||
"allocation" : "primary|replica|unused" <5>
|
||||
"store_exception": ... <6>
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"indices": {
|
||||
"my-index-00001": {
|
||||
"shards": {
|
||||
"0": { <1>
|
||||
"stores": [ <2>
|
||||
{
|
||||
"sPa3OgxLSYGvQ4oPs-Tajw": { <3>
|
||||
"name": "node_t0",
|
||||
"ephemeral_id": "9NlXRFGCT1m8tkvYCMK-8A",
|
||||
"transport_address": "local[1]",
|
||||
"attributes": {}
|
||||
},
|
||||
"allocation_id": "2iNySv_OQVePRX-yaRH_lQ", <4>
|
||||
"allocation": "primary|replica|unused" <5>
|
||||
"store_exception": ... <6>
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/"store_exception": \.\.\.//]
|
||||
|
|
|
@ -14,7 +14,7 @@ existing <<indices-templates, index template>>.
|
|||
--------------------------------------------------
|
||||
PUT _index_template/template_1
|
||||
{
|
||||
"index_patterns": ["myindex*"],
|
||||
"index_patterns": ["my-index-*"],
|
||||
"template": {
|
||||
"settings": {
|
||||
"number_of_shards": 1
|
||||
|
@ -33,7 +33,7 @@ DELETE _index_template/*
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /_index_template/_simulate_index/myindex-1
|
||||
POST /_index_template/_simulate_index/my-index-000001
|
||||
--------------------------------------------------
|
||||
|
||||
[[simulate-index-api-request]]
|
||||
|
@ -99,7 +99,7 @@ Response includes an empty object if no settings would be applied.
|
|||
[[simulate-index-api-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
The following example shows the configuration that would be applied to `myindex-1` by
|
||||
The following example shows the configuration that would be applied to `my-index-000001` by
|
||||
an existing template.
|
||||
|
||||
[source,console]
|
||||
|
@ -131,17 +131,17 @@ PUT /_component_template/ct2 <2>
|
|||
|
||||
PUT /_index_template/final-template <3>
|
||||
{
|
||||
"index_patterns": ["myindex*"],
|
||||
"index_patterns": ["my-index-*"],
|
||||
"composed_of": ["ct1", "ct2"],
|
||||
"priority": 5
|
||||
}
|
||||
|
||||
POST /_index_template/_simulate_index/myindex-1 <4>
|
||||
POST /_index_template/_simulate_index/my-index-000001 <4>
|
||||
--------------------------------------------------
|
||||
<1> Create a component template (`ct1`) that sets the number of shards to 2
|
||||
<2> Create a second component template (`ct2`) that sets the number of replicas to 0 and defines a mapping
|
||||
<3> Create an index template (`final-template`) that uses the component templates
|
||||
<4> Show the configuration that would be applied to `myindex-1`
|
||||
<4> Show the configuration that would be applied to `my-index-000001`
|
||||
|
||||
The response shows the index settings, mappings, and aliases applied by the `final-template`:
|
||||
|
||||
|
@ -168,7 +168,7 @@ The response shows the index settings, mappings, and aliases applied by the `fin
|
|||
{
|
||||
"name" : "template_1",
|
||||
"index_patterns" : [
|
||||
"myindex*"
|
||||
"my-index-*"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -33,7 +33,7 @@ DELETE /_index_template/template_1
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
POST /_index_template/_simulate_index/myindex
|
||||
POST /_index_template/_simulate_index/my-index-000001
|
||||
--------------------------------------------------
|
||||
|
||||
To simulate the settings that would be applied from an existing template:
|
||||
|
|
|
@ -204,7 +204,7 @@ PUT /_component_template/ct2 <2>
|
|||
|
||||
PUT /_index_template/final-template <3>
|
||||
{
|
||||
"index_patterns": ["myindex*"],
|
||||
"index_patterns": ["my-index-*"],
|
||||
"composed_of": ["ct1", "ct2"],
|
||||
"priority": 5
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ The specified template is used for the simulation if it has a higher priority th
|
|||
--------------------------------------------------
|
||||
POST /_index_template/_simulate
|
||||
{
|
||||
"index_patterns": ["myindex*"],
|
||||
"index_patterns": ["my-index-*"],
|
||||
"composed_of": ["ct2"],
|
||||
"priority": 10,
|
||||
"template": {
|
||||
|
@ -292,7 +292,7 @@ The response shows any overlapping templates with a lower priority.
|
|||
{
|
||||
"name" : "final-template",
|
||||
"index_patterns" : [
|
||||
"myindex*"
|
||||
"my-index-*"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -48,7 +48,7 @@ Index with defined pipeline
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my-index/_doc/my-id?pipeline=my_pipeline_id
|
||||
PUT my-index-00001/_doc/my-id?pipeline=my_pipeline_id
|
||||
{
|
||||
"foo": "bar"
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ Response:
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"_index" : "my-index",
|
||||
"_index" : "my-index-00001",
|
||||
"_type" : "_doc",
|
||||
"_id" : "my-id",
|
||||
"_version" : 1,
|
||||
|
|
|
@ -571,7 +571,7 @@ include the `field` specified in your enrich processor.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my_index/_doc/my_id?pipeline=user_lookup
|
||||
PUT /my-index-00001/_doc/my_id?pipeline=user_lookup
|
||||
{
|
||||
"email": "mardy.brown@asciidocsmith.com"
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ use the <<docs-get,get API>> to view the indexed document.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my_index/_doc/my_id
|
||||
GET /my-index-00001/_doc/my_id
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -593,7 +593,7 @@ The API returns the following response:
|
|||
----
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id",
|
||||
"_version": 1,
|
||||
|
|
|
@ -13,7 +13,7 @@ the provided index name prefix and the provided date rounding get formatted into
|
|||
Also here optionally date formatting can be specified on how the date should be formatted into a date math index name
|
||||
expression.
|
||||
|
||||
An example pipeline that points documents to a monthly index that starts with a `myindex-` prefix based on a
|
||||
An example pipeline that points documents to a monthly index that starts with a `my-index-` prefix based on a
|
||||
date in the `date1` field:
|
||||
|
||||
[source,console]
|
||||
|
@ -25,7 +25,7 @@ PUT _ingest/pipeline/monthlyindex
|
|||
{
|
||||
"date_index_name" : {
|
||||
"field" : "date1",
|
||||
"index_name_prefix" : "myindex-",
|
||||
"index_name_prefix" : "my-index-",
|
||||
"date_rounding" : "M"
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ Using that pipeline for an index request:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /myindex/_doc/1?pipeline=monthlyindex
|
||||
PUT /my-index/_doc/1?pipeline=monthlyindex
|
||||
{
|
||||
"date1" : "2016-04-25T12:02:01.789Z"
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ PUT /myindex/_doc/1?pipeline=monthlyindex
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"_index" : "myindex-2016-04-01",
|
||||
"_index" : "my-index-2016-04-01",
|
||||
"_type" : "_doc",
|
||||
"_id" : "1",
|
||||
"_version" : 1,
|
||||
|
@ -65,11 +65,11 @@ PUT /myindex/_doc/1?pipeline=monthlyindex
|
|||
// TESTRESPONSE[s/"_seq_no" : \d+/"_seq_no" : $body._seq_no/ s/"_primary_term" : 1/"_primary_term" : $body._primary_term/]
|
||||
|
||||
|
||||
The above request will not index this document into the `myindex` index, but into the `myindex-2016-04-01` index because
|
||||
The above request will not index this document into the `my-index` index, but into the `my-index-2016-04-01` index because
|
||||
it was rounded by month. This is because the date-index-name-processor overrides the `_index` property of the document.
|
||||
|
||||
To see the date-math value of the index supplied in the actual index request which resulted in the above document being
|
||||
indexed into `myindex-2016-04-01` we can inspect the effects of the processor using a simulate request.
|
||||
indexed into `my-index-2016-04-01` we can inspect the effects of the processor using a simulate request.
|
||||
|
||||
|
||||
[source,console]
|
||||
|
@ -83,7 +83,7 @@ POST _ingest/pipeline/_simulate
|
|||
{
|
||||
"date_index_name" : {
|
||||
"field" : "date1",
|
||||
"index_name_prefix" : "myindex-",
|
||||
"index_name_prefix" : "my-index-",
|
||||
"date_rounding" : "M"
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ and the result:
|
|||
{
|
||||
"doc" : {
|
||||
"_id" : "_id",
|
||||
"_index" : "<myindex-{2016-04-25||/M{yyyy-MM-dd|UTC}}>",
|
||||
"_index" : "<my-index-{2016-04-25||/M{yyyy-MM-dd|UTC}}>",
|
||||
"_type" : "_doc",
|
||||
"_source" : {
|
||||
"date1" : "2016-04-25T12:02:01.789Z"
|
||||
|
@ -123,7 +123,7 @@ and the result:
|
|||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/2016-11-08T19:43:03.850\+0000/$body.docs.0.doc._ingest.timestamp/]
|
||||
|
||||
The above example shows that `_index` was set to `<myindex-{2016-04-25||/M{yyyy-MM-dd|UTC}}>`. Elasticsearch
|
||||
The above example shows that `_index` was set to `<my-index-{2016-04-25||/M{yyyy-MM-dd|UTC}}>`. Elasticsearch
|
||||
understands this to mean `2016-04-01` as is explained in the <<date-math-index-names, date math index name documentation>>
|
||||
|
||||
[[date-index-name-options]]
|
||||
|
|
|
@ -55,11 +55,11 @@ PUT _ingest/pipeline/geoip
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id?pipeline=geoip
|
||||
PUT my-index-00001/_doc/my_id?pipeline=geoip
|
||||
{
|
||||
"ip": "8.8.8.8"
|
||||
}
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-00001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
Which returns:
|
||||
|
@ -68,7 +68,7 @@ Which returns:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id",
|
||||
"_version": 1,
|
||||
|
@ -105,11 +105,11 @@ PUT _ingest/pipeline/geoip
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id?pipeline=geoip
|
||||
PUT my-index-00001/_doc/my_id?pipeline=geoip
|
||||
{
|
||||
"ip": "8.8.8.8"
|
||||
}
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-00001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
returns this:
|
||||
|
@ -118,7 +118,7 @@ returns this:
|
|||
--------------------------------------------------
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-00001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id",
|
||||
"_version": 1,
|
||||
|
@ -156,12 +156,12 @@ PUT _ingest/pipeline/geoip
|
|||
]
|
||||
}
|
||||
|
||||
PUT my_index/_doc/my_id?pipeline=geoip
|
||||
PUT my-index-00001/_doc/my_id?pipeline=geoip
|
||||
{
|
||||
"ip": "80.231.5.0"
|
||||
}
|
||||
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-00001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
Which returns:
|
||||
|
@ -169,7 +169,7 @@ Which returns:
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"_index" : "my_index",
|
||||
"_index" : "my-index-00001",
|
||||
"_type" : "_doc",
|
||||
"_id" : "my_id",
|
||||
"_version" : 1,
|
||||
|
|
|
@ -72,7 +72,7 @@ from the outer pipeline:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT /myindex/_doc/1?pipeline=pipelineB
|
||||
PUT /my-index/_doc/1?pipeline=pipelineB
|
||||
{
|
||||
"field": "value"
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ Response from the index request:
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"_index": "myindex",
|
||||
"_index": "my-index",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 1,
|
||||
|
|
|
@ -43,19 +43,19 @@ numeric fields `field_a` and `field_b` multiplied by the parameter param_c:
|
|||
// NOTCONSOLE
|
||||
|
||||
It is possible to use the Script Processor to manipulate document metadata like `_index` and `_type` during
|
||||
ingestion. Here is an example of an Ingest Pipeline that renames the index and type to `my_index` no matter what
|
||||
ingestion. Here is an example of an Ingest Pipeline that renames the index and type to `my-index` no matter what
|
||||
was provided in the original index request:
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT _ingest/pipeline/my_index
|
||||
PUT _ingest/pipeline/my-index
|
||||
{
|
||||
"description": "use index:my_index",
|
||||
"description": "use index:my-index",
|
||||
"processors": [
|
||||
{
|
||||
"script": {
|
||||
"source": """
|
||||
ctx._index = 'my_index';
|
||||
ctx._index = 'my-index';
|
||||
ctx._type = '_doc';
|
||||
"""
|
||||
}
|
||||
|
@ -64,11 +64,11 @@ PUT _ingest/pipeline/my_index
|
|||
}
|
||||
--------------------------------------------------
|
||||
|
||||
Using the above pipeline, we can attempt to index a document into the `any_index` index.
|
||||
Using the above pipeline, we can attempt to index a document into the `any-index` index.
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT any_index/_doc/1?pipeline=my_index
|
||||
PUT any-index/_doc/1?pipeline=my-index
|
||||
{
|
||||
"message": "text"
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ The response from the above index request:
|
|||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"_index": "my_index",
|
||||
"_index": "my-index",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 1,
|
||||
|
@ -96,6 +96,6 @@ The response from the above index request:
|
|||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/"_seq_no": \d+/"_seq_no" : $body._seq_no/ s/"_primary_term" : 1/"_primary_term" : $body._primary_term/]
|
||||
|
||||
In the above response, you can see that our document was actually indexed into `my_index` instead of
|
||||
`any_index`. This type of manipulation is often convenient in pipelines that have various branches of transformation,
|
||||
In the above response, you can see that our document was actually indexed into `my-index` instead of
|
||||
`any-index`. This type of manipulation is often convenient in pipelines that have various branches of transformation,
|
||||
and depending on the progress made, indexed into different indices.
|
||||
|
|
|
@ -37,11 +37,11 @@ PUT _ingest/pipeline/user_agent
|
|||
}
|
||||
]
|
||||
}
|
||||
PUT my_index/_doc/my_id?pipeline=user_agent
|
||||
PUT my-index-000001/_doc/my_id?pipeline=user_agent
|
||||
{
|
||||
"agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
|
||||
}
|
||||
GET my_index/_doc/my_id
|
||||
GET my-index-000001/_doc/my_id
|
||||
--------------------------------------------------
|
||||
|
||||
Which returns
|
||||
|
@ -50,7 +50,7 @@ Which returns
|
|||
--------------------------------------------------
|
||||
{
|
||||
"found": true,
|
||||
"_index": "my_index",
|
||||
"_index": "my-index-000001",
|
||||
"_type": "_doc",
|
||||
"_id": "my_id",
|
||||
"_version": 1,
|
||||
|
|
|
@ -145,7 +145,7 @@ with an explicit mapping.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my-index
|
||||
PUT /my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -174,7 +174,7 @@ for the `employee-id` field are stored but not indexed or available for search.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
PUT /my-index/_mapping
|
||||
PUT /my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"employee-id": {
|
||||
|
@ -203,7 +203,7 @@ an existing index.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my-index/_mapping
|
||||
GET /my-index-000001/_mapping
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -212,7 +212,7 @@ The API returns the following response:
|
|||
[source,console-result]
|
||||
----
|
||||
{
|
||||
"my-index" : {
|
||||
"my-index-000001" : {
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"age" : {
|
||||
|
@ -249,7 +249,7 @@ The following request retrieves the mapping for the `employee-id` field.
|
|||
|
||||
[source,console]
|
||||
----
|
||||
GET /my-index/_mapping/field/employee-id
|
||||
GET /my-index-000001/_mapping/field/employee-id
|
||||
----
|
||||
// TEST[continued]
|
||||
|
||||
|
@ -258,7 +258,7 @@ The API returns the following response:
|
|||
[source,console-result]
|
||||
----
|
||||
{
|
||||
"my-index" : {
|
||||
"my-index-000001" : {
|
||||
"mappings" : {
|
||||
"employee-id" : {
|
||||
"full_name" : "employee-id",
|
||||
|
|
|
@ -48,12 +48,12 @@ For example:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"create_date": "2015/09/02"
|
||||
}
|
||||
|
||||
GET my_index/_mapping <1>
|
||||
GET my-index-000001/_mapping <1>
|
||||
--------------------------------------------------
|
||||
|
||||
<1> The `create_date` field has been added as a <<date,`date`>>
|
||||
|
@ -66,14 +66,14 @@ Dynamic date detection can be disabled by setting `date_detection` to `false`:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"date_detection": false
|
||||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1 <1>
|
||||
PUT my-index-000001/_doc/1 <1>
|
||||
{
|
||||
"create": "2015/09/02"
|
||||
}
|
||||
|
@ -88,14 +88,14 @@ own <<mapping-date-format,date formats>>:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_date_formats": ["MM/dd/yyyy"]
|
||||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"create_date": "09/25/2015"
|
||||
}
|
||||
|
@ -113,14 +113,14 @@ correct solution is to map these fields explicitly, but numeric detection
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"numeric_detection": true
|
||||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"my_float": "1.0", <1>
|
||||
"my_integer": "1" <2>
|
||||
|
|
|
@ -83,7 +83,7 @@ could use the following template:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -113,7 +113,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"my_integer": 5, <1>
|
||||
"my_string": "Some string" <2>
|
||||
|
@ -137,7 +137,7 @@ fields:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -155,7 +155,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"long_num": "5", <1>
|
||||
"long_text": "foo" <2>
|
||||
|
@ -191,7 +191,7 @@ top-level `full_name` field, except for the `middle` field:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -209,7 +209,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"name": {
|
||||
"first": "John",
|
||||
|
@ -226,7 +226,7 @@ field `name.title`, which can't be mapped as text:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"name": {
|
||||
"first": "Paul",
|
||||
|
@ -251,7 +251,7 @@ field, and disables <<doc-values,`doc_values`>> for all non-string fields:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -278,7 +278,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"english": "Some English text", <1>
|
||||
"count": 5 <2>
|
||||
|
@ -303,7 +303,7 @@ you will have to search on the exact same value that was indexed.
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -331,7 +331,7 @@ before 5.0):
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -356,7 +356,7 @@ disable the storage of these scoring factors in the index and save some space.
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
@ -394,7 +394,7 @@ maybe gain some indexing speed:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic_templates": [
|
||||
|
|
|
@ -11,17 +11,17 @@ The value of the `_id` field is accessible in certain queries (`term`,
|
|||
[source,console]
|
||||
--------------------------
|
||||
# Example documents
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"text": "Document with ID 1"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2?refresh=true
|
||||
PUT my-index-000001/_doc/2?refresh=true
|
||||
{
|
||||
"text": "Document with ID 2"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"terms": {
|
||||
|
|
|
@ -7,7 +7,7 @@ metadata, such as the class that a document belongs to:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"_meta": { <1>
|
||||
|
@ -29,7 +29,7 @@ The `_meta` field can be updated on an existing type using the
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index/_mapping
|
||||
PUT my-index-000001/_mapping
|
||||
{
|
||||
"_meta": {
|
||||
"class": "MyApp2::User3",
|
||||
|
|
|
@ -13,12 +13,12 @@ value per document. For instance:
|
|||
|
||||
[source,console]
|
||||
------------------------------
|
||||
PUT my_index/_doc/1?routing=user1&refresh=true <1>
|
||||
PUT my-index-000001/_doc/1?routing=user1&refresh=true <1>
|
||||
{
|
||||
"title": "This is a document"
|
||||
}
|
||||
|
||||
GET my_index/_doc/1?routing=user1 <2>
|
||||
GET my-index-000001/_doc/1?routing=user1 <2>
|
||||
------------------------------
|
||||
// TESTSETUP
|
||||
|
||||
|
@ -31,7 +31,7 @@ The value of the `_routing` field is accessible in queries:
|
|||
|
||||
[source,console]
|
||||
--------------------------
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"terms": {
|
||||
|
@ -54,7 +54,7 @@ just the shard that matches the specific routing value (or values):
|
|||
|
||||
[source,console]
|
||||
------------------------------
|
||||
GET my_index/_search?routing=user1,user2 <1>
|
||||
GET my-index-000001/_search?routing=user1,user2 <1>
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
|
@ -79,7 +79,7 @@ custom `routing` value required for all CRUD operations:
|
|||
|
||||
[source,console]
|
||||
------------------------------
|
||||
PUT my_index2
|
||||
PUT my-index-000002
|
||||
{
|
||||
"mappings": {
|
||||
"_routing": {
|
||||
|
@ -88,7 +88,7 @@ PUT my_index2
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index2/_doc/1 <2>
|
||||
PUT my-index-000002/_doc/1 <2>
|
||||
{
|
||||
"text": "No routing value provided"
|
||||
}
|
||||
|
|
|
@ -14,12 +14,12 @@ scripts, and when sorting:
|
|||
--------------------------
|
||||
# Example documents
|
||||
|
||||
PUT my_index/_doc/1?refresh=true
|
||||
PUT my-index-000001/_doc/1?refresh=true
|
||||
{
|
||||
"text": "Document with type 'doc'"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"term": {
|
||||
|
|
|
@ -33,7 +33,7 @@ To disable stop words for phrases a field utilising three analyzer settings will
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings":{
|
||||
"analysis":{
|
||||
|
@ -74,17 +74,17 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"title":"The Quick Brown Fox"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"title":"A Quick Brown Fox"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query":{
|
||||
"query_string":{
|
||||
|
|
|
@ -6,7 +6,7 @@ Individual fields can be _boosted_ automatically -- count more towards the relev
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
|
|
@ -17,7 +17,7 @@ For instance:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -32,12 +32,12 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"number_one": "10" <1>
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"number_two": "10" <2>
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ coercion globally across all mapping types:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.mapping.coerce": false
|
||||
|
@ -76,10 +76,10 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{ "number_one": "10" } <1>
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{ "number_two": "10" } <2>
|
||||
--------------------------------------------------
|
||||
// TEST[catch:bad_request]
|
||||
|
|
|
@ -8,7 +8,7 @@ the `full_name` field as follows:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -27,13 +27,13 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"first_name": "John",
|
||||
"last_name": "Smith"
|
||||
}
|
||||
|
||||
GET my_index/_search
|
||||
GET my-index-000001/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
|
|
|
@ -23,7 +23,7 @@ value from a script, you can disable doc values in order to save disk space:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
|
|
@ -7,7 +7,7 @@ containing the new field. For instance:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index/_doc/1 <1>
|
||||
PUT my-index-000001/_doc/1 <1>
|
||||
{
|
||||
"username": "johnsmith",
|
||||
"name": {
|
||||
|
@ -16,9 +16,9 @@ PUT my_index/_doc/1 <1>
|
|||
}
|
||||
}
|
||||
|
||||
GET my_index/_mapping <2>
|
||||
GET my-index-000001/_mapping <2>
|
||||
|
||||
PUT my_index/_doc/2 <3>
|
||||
PUT my-index-000001/_doc/2 <3>
|
||||
{
|
||||
"username": "marywhite",
|
||||
"email": "mary@white.com",
|
||||
|
@ -29,7 +29,7 @@ PUT my_index/_doc/2 <3>
|
|||
}
|
||||
}
|
||||
|
||||
GET my_index/_mapping <4>
|
||||
GET my-index-000001/_mapping <4>
|
||||
--------------------------------------------------
|
||||
|
||||
<1> This document introduces the string field `username`, the object field
|
||||
|
@ -58,7 +58,7 @@ object or from the mapping type. For instance:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"dynamic": false, <1>
|
||||
|
|
|
@ -51,7 +51,7 @@ aggregations:
|
|||
|
||||
[source,console]
|
||||
------------
|
||||
PUT my_index/_mapping
|
||||
PUT my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"tags": {
|
||||
|
@ -61,7 +61,7 @@ PUT my_index/_mapping
|
|||
}
|
||||
}
|
||||
------------
|
||||
// TEST[s/^/PUT my_index\n/]
|
||||
// TEST[s/^/PUT my-index-000001\n/]
|
||||
|
||||
When `eager_global_ordinals` is enabled, global ordinals are built when a shard
|
||||
is <<indices-refresh, refreshed>> -- Elasticsearch always loads them before
|
||||
|
@ -74,7 +74,7 @@ Eager loading can be disabled at any time by updating the `eager_global_ordinals
|
|||
|
||||
[source,console]
|
||||
------------
|
||||
PUT my_index/_mapping
|
||||
PUT my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"tags": {
|
||||
|
|
|
@ -15,7 +15,7 @@ stored in any other way:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -33,7 +33,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/session_1
|
||||
PUT my-index-000001/_doc/session_1
|
||||
{
|
||||
"user_id": "kimchy",
|
||||
"session_data": { <2>
|
||||
|
@ -44,7 +44,7 @@ PUT my_index/_doc/session_1
|
|||
"last_updated": "2015-12-06T18:20:22"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/session_2
|
||||
PUT my-index-000001/_doc/session_2
|
||||
{
|
||||
"user_id": "jpountz",
|
||||
"session_data": "none", <3>
|
||||
|
@ -62,14 +62,14 @@ retrieved, but none of its contents are indexed in any way:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"enabled": false <1>
|
||||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/session_1
|
||||
PUT my-index-000001/_doc/session_1
|
||||
{
|
||||
"user_id": "kimchy",
|
||||
"session_data": {
|
||||
|
@ -80,9 +80,9 @@ PUT my_index/_doc/session_1
|
|||
"last_updated": "2015-12-06T18:20:22"
|
||||
}
|
||||
|
||||
GET my_index/_doc/session_1 <2>
|
||||
GET my-index-000001/_doc/session_1 <2>
|
||||
|
||||
GET my_index/_mapping <3>
|
||||
GET my-index-000001/_mapping <3>
|
||||
--------------------------------------------------
|
||||
|
||||
<1> The entire mapping is disabled.
|
||||
|
@ -97,7 +97,7 @@ contents, it is possible to add non-object data to a disabled field:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -109,7 +109,7 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/session_1
|
||||
PUT my-index-000001/_doc/session_1
|
||||
{
|
||||
"session_data": "foo bar" <1>
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ enabled for aggregations, as follows:
|
|||
|
||||
[source,console]
|
||||
---------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -82,7 +82,7 @@ You can enable fielddata on an existing `text` field using the
|
|||
|
||||
[source,console]
|
||||
-----------------------------------
|
||||
PUT my_index/_mapping
|
||||
PUT my-index-000001/_mapping
|
||||
{
|
||||
"properties": {
|
||||
"my_field": { <1>
|
||||
|
@ -115,7 +115,7 @@ number of docs that the segment should contain with `min_segment_size`:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
|
|
@ -11,7 +11,7 @@ Besides the <<built-in-date-formats,built-in formats>>, your own
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
|
|
@ -8,7 +8,7 @@ NOTE: All strings/array elements will still be present in the `_source` field, i
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -20,17 +20,17 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1 <2>
|
||||
PUT my-index-000001/_doc/1 <2>
|
||||
{
|
||||
"message": "Syntax error"
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2 <3>
|
||||
PUT my-index-000001/_doc/2 <3>
|
||||
{
|
||||
"message": "Syntax error with some long stacktrace"
|
||||
}
|
||||
|
||||
GET my_index/_search <4>
|
||||
GET my-index-000001/_search <4>
|
||||
{
|
||||
"aggs": {
|
||||
"messages": {
|
||||
|
|
|
@ -14,7 +14,7 @@ For example:
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
|
@ -29,13 +29,13 @@ PUT my_index
|
|||
}
|
||||
}
|
||||
|
||||
PUT my_index/_doc/1
|
||||
PUT my-index-000001/_doc/1
|
||||
{
|
||||
"text": "Some text value",
|
||||
"number_one": "foo" <1>
|
||||
}
|
||||
|
||||
PUT my_index/_doc/2
|
||||
PUT my-index-000001/_doc/2
|
||||
{
|
||||
"text": "Some text value",
|
||||
"number_two": "foo" <2>
|
||||
|
@ -67,7 +67,7 @@ Mapping types that don't support the setting will ignore it if set on the index
|
|||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
PUT my_index
|
||||
PUT my-index-000001
|
||||
{
|
||||
"settings": {
|
||||
"index.mapping.ignore_malformed": true <1>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue