Setting doc_values for _id field in elasticSearch
up vote
0
down vote
favorite
I want to set doc_values for _id field in elastic search As want to perform sorting based on _id
hitting below api to update mapping gives me an error
PUT my_index/my_type/_mapping
{
"properties": {
"_id": {
"type": "keyword",
"doc_values": true
}
}
}
reason : Mapping definition for [_id] has unsupported parameters: [doc_value : true]
elasticsearch kibana
add a comment |
up vote
0
down vote
favorite
I want to set doc_values for _id field in elastic search As want to perform sorting based on _id
hitting below api to update mapping gives me an error
PUT my_index/my_type/_mapping
{
"properties": {
"_id": {
"type": "keyword",
"doc_values": true
}
}
}
reason : Mapping definition for [_id] has unsupported parameters: [doc_value : true]
elasticsearch kibana
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to set doc_values for _id field in elastic search As want to perform sorting based on _id
hitting below api to update mapping gives me an error
PUT my_index/my_type/_mapping
{
"properties": {
"_id": {
"type": "keyword",
"doc_values": true
}
}
}
reason : Mapping definition for [_id] has unsupported parameters: [doc_value : true]
elasticsearch kibana
I want to set doc_values for _id field in elastic search As want to perform sorting based on _id
hitting below api to update mapping gives me an error
PUT my_index/my_type/_mapping
{
"properties": {
"_id": {
"type": "keyword",
"doc_values": true
}
}
}
reason : Mapping definition for [_id] has unsupported parameters: [doc_value : true]
elasticsearch kibana
elasticsearch kibana
edited yesterday
asked yesterday
Steve
186
186
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
It is “doc_values”, you are using an incorrect parameter. https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
Elastic discourages sorting on _id field. See this
The value of the _id field is also accessible in aggregations or for sorting, but doing so is discouraged as it requires to load a lot of data in memory. In case sorting or aggregating on the _id field is required, it is advised to duplicate the content of the _id field in another field that has doc_values enabled.
EDIT
Create a scripted field for your index pattern with name for. ex id
of type string
and script doc['_id'].value
. See this link for more information on scripted fields. This will create a new field id
and copy _id
field's value for every document indexed into your indices matching your index pattern. You can then perform sorting on id
field.
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
See my edit above.
– ben5556
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It is “doc_values”, you are using an incorrect parameter. https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
Elastic discourages sorting on _id field. See this
The value of the _id field is also accessible in aggregations or for sorting, but doing so is discouraged as it requires to load a lot of data in memory. In case sorting or aggregating on the _id field is required, it is advised to duplicate the content of the _id field in another field that has doc_values enabled.
EDIT
Create a scripted field for your index pattern with name for. ex id
of type string
and script doc['_id'].value
. See this link for more information on scripted fields. This will create a new field id
and copy _id
field's value for every document indexed into your indices matching your index pattern. You can then perform sorting on id
field.
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
See my edit above.
– ben5556
yesterday
add a comment |
up vote
0
down vote
It is “doc_values”, you are using an incorrect parameter. https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
Elastic discourages sorting on _id field. See this
The value of the _id field is also accessible in aggregations or for sorting, but doing so is discouraged as it requires to load a lot of data in memory. In case sorting or aggregating on the _id field is required, it is advised to duplicate the content of the _id field in another field that has doc_values enabled.
EDIT
Create a scripted field for your index pattern with name for. ex id
of type string
and script doc['_id'].value
. See this link for more information on scripted fields. This will create a new field id
and copy _id
field's value for every document indexed into your indices matching your index pattern. You can then perform sorting on id
field.
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
See my edit above.
– ben5556
yesterday
add a comment |
up vote
0
down vote
up vote
0
down vote
It is “doc_values”, you are using an incorrect parameter. https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
Elastic discourages sorting on _id field. See this
The value of the _id field is also accessible in aggregations or for sorting, but doing so is discouraged as it requires to load a lot of data in memory. In case sorting or aggregating on the _id field is required, it is advised to duplicate the content of the _id field in another field that has doc_values enabled.
EDIT
Create a scripted field for your index pattern with name for. ex id
of type string
and script doc['_id'].value
. See this link for more information on scripted fields. This will create a new field id
and copy _id
field's value for every document indexed into your indices matching your index pattern. You can then perform sorting on id
field.
It is “doc_values”, you are using an incorrect parameter. https://www.elastic.co/guide/en/elasticsearch/reference/current/doc-values.html
Elastic discourages sorting on _id field. See this
The value of the _id field is also accessible in aggregations or for sorting, but doing so is discouraged as it requires to load a lot of data in memory. In case sorting or aggregating on the _id field is required, it is advised to duplicate the content of the _id field in another field that has doc_values enabled.
EDIT
Create a scripted field for your index pattern with name for. ex id
of type string
and script doc['_id'].value
. See this link for more information on scripted fields. This will create a new field id
and copy _id
field's value for every document indexed into your indices matching your index pattern. You can then perform sorting on id
field.
edited yesterday
answered yesterday
ben5556
1,275138
1,275138
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
See my edit above.
– ben5556
yesterday
add a comment |
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
See my edit above.
– ben5556
yesterday
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
Corrected doc_values, still getting an error Field [_id] is defined twice in [type]. There is no field with _id in my mapping
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
how can I copy _id value to a different field?
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
even copying _id gives me same error, how can I use elasticsearch meta fields
– Steve
yesterday
See my edit above.
– ben5556
yesterday
See my edit above.
– ben5556
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372613%2fsetting-doc-values-for-id-field-in-elasticsearch%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown