Skip to content

[7.8] [DOCS] Update my-index examples (#60132) #60250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/painless/painless-guide/painless-execute-script.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -90,7 +90,7 @@ POST /_scripts/painless/_execute
},
"context": "filter",
"context_setup": {
"index": "my-index",
"index": "my-index-000001",
"document": {
"field": "four"
}
Expand Down Expand Up @@ -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": {
Expand All @@ -148,7 +148,7 @@ POST /_scripts/painless/_execute
},
"context": "score",
"context_setup": {
"index": "my-index",
"index": "my-index-000001",
"document": {
"rank": 4
}
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/analysis-icu.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -368,7 +368,7 @@ PUT my_index
}
}

GET /my_index/_search <3>
GET /my-index-000001/_search <3>
{
"query": {
"match": {
Expand Down
24 changes: 12 additions & 12 deletions docs/plugins/ingest-attachment.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -58,7 +58,7 @@ Returns this:
--------------------------------------------------
{
"found": true,
"_index": "my_index",
"_index": "my-index-00001",
"_type": "_doc",
"_id": "my_id",
"_version": 1,
Expand Down Expand Up @@ -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:
Expand All @@ -141,7 +141,7 @@ Returns this:
--------------------------------------------------
{
"found": true,
"_index": "my_index",
"_index": "my-index-00001",
"_type": "_doc",
"_id": "my_id",
"_version": 1,
Expand Down Expand Up @@ -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:
Expand All @@ -190,7 +190,7 @@ Returns this:
--------------------------------------------------
{
"found": true,
"_index": "my_index",
"_index": "my-index-00001",
"_type": "_doc",
"_id": "my_id_2",
"_version": 1,
Expand Down Expand Up @@ -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" : [
{
Expand All @@ -275,15 +275,15 @@ PUT my_index/_doc/my_id?pipeline=attachment
}
]
}
GET my_index/_doc/my_id
GET my-index-00001/_doc/my_id
--------------------------------------------------

Returns this:

[source,console-result]
--------------------------------------------------
{
"_index" : "my_index",
"_index" : "my-index-00001",
"_type" : "_doc",
"_id" : "my_id",
"_version" : 1,
Expand Down
20 changes: 10 additions & 10 deletions docs/plugins/mapper-annotated-text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ the search index:

[source,console]
--------------------------
PUT my_index
PUT my-index-000001
{
"mappings": {
"properties": {
Expand All @@ -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."
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions docs/plugins/mapper-murmur3.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ value and its hash are stored in the index:

[source,console]
--------------------------
PUT my_index
PUT my-index-000001
{
"mappings": {
"properties": {
Expand All @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions docs/plugins/mapper-size.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/store-smb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions docs/python/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -185,7 +185,7 @@ midnight UTC:

[source,console]
---------------------------------
GET my_index/_search?size=0
GET my-index-00001/_search?size=0
{
"aggs": {
"by_day": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading