Due to a change in the source content that I am indexing, I need to update a
field from a long to string.
The original mapping is dynamic, no explicit mapping was ever provided:
"event": {
"dynamic": "true",
"event_id": { "type": "long" },
// other fields ...
}
The field is never used and I do not care of "legacy" documents having the
correct type. Looking to change this value to a simple not_analyzed string:
"event_id": { "type": "string", "index": "not_analyzed" }
Of course, an update mapping between types does not work:
{"error":"MergeMappingException[Merge failed with failures {[mapper
[event.event_id] of different type, current_type [long], merged_type
[string]]}]","status":400}
At this point I set ignore_conflicts=true and executed the update mapping
(via curl). I received an acknowledgment, but the mapping is not executed.
{"ok":true,"acknowledged":true}
No errors appear in the log. I used used (abused?) ignore_conflicts in the
past with success, but I am not surprised it does not work in every case.
What are the cases were an update to a mapping simply is not possible?
My next question is for reindexing recipes, but that is for a different
thread.
updates to the mapping in your case will cause a lot of trouble.
change the mapping and create a new index. then reindex and switch the
alias and optionally delete the old index.
Due to a change in the source content that I am indexing, I need to update a
field from a long to string.
The original mapping is dynamic, no explicit mapping was ever provided:
"event": {
"dynamic": "true",
"event_id": { "type": "long" },
// other fields ...
}
The field is never used and I do not care of "legacy" documents having the
correct type. Looking to change this value to a simple not_analyzed string:
"event_id": { "type": "string", "index": "not_analyzed" }
Of course, an update mapping between types does not work:
{"error":"MergeMappingException[Merge failed with failures {[mapper
[event.event_id] of different type, current_type [long], merged_type
[string]]}]","status":400}
At this point I set ignore_conflicts=true and executed the update mapping
(via curl). I received an acknowledgment, but the mapping is not executed.
{"ok":true,"acknowledged":true}
No errors appear in the log. I used used (abused?) ignore_conflicts in the
past with success, but I am not surprised it does not work in every case.
What are the cases were an update to a mapping simply is not possible?
My next question is for reindexing recipes, but that is for a different
thread.
You can't change the type of a field mapped, even when ignore_conflicts is
set to true. Ignore conflicts simply does that, ignore the conflicts and
applies what it can, it does not apply conflicts.
On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic ivan@brusic.com wrote:
Using ES 0.16.2
Due to a change in the source content that I am indexing, I need to update
a field from a long to string.
The original mapping is dynamic, no explicit mapping was ever provided:
"event": {
"dynamic": "true",
"event_id": { "type": "long" },
// other fields ...
}
The field is never used and I do not care of "legacy" documents having the
correct type. Looking to change this value to a simple not_analyzed string:
"event_id": { "type": "string", "index": "not_analyzed" }
Of course, an update mapping between types does not work:
{"error":"MergeMappingException[Merge failed with failures {[mapper
[event.event_id] of different type, current_type [long], merged_type
[string]]}]","status":400}
At this point I set ignore_conflicts=true and executed the update mapping
(via curl). I received an acknowledgment, but the mapping is not executed.
{"ok":true,"acknowledged":true}
No errors appear in the log. I used used (abused?) ignore_conflicts in the
past with success, but I am not surprised it does not work in every case.
What are the cases were an update to a mapping simply is not possible?
My next question is for reindexing recipes, but that is for a different
thread.
You can't change the type of a field mapped, even when ignore_conflicts is
set to true. Ignore conflicts simply does that, ignore the conflicts and
applies what it can, it does not apply conflicts.
On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic ivan@brusic.com wrote:
Using ES 0.16.2
Due to a change in the source content that I am indexing, I need to update
a field from a long to string.
The original mapping is dynamic, no explicit mapping was ever provided:
"event": {
"dynamic": "true",
"event_id": { "type": "long" },
// other fields ...
}
The field is never used and I do not care of "legacy" documents having the
correct type. Looking to change this value to a simple not_analyzed string:
"event_id": { "type": "string", "index": "not_analyzed" }
Of course, an update mapping between types does not work:
{"error":"MergeMappingException[Merge failed with failures {[mapper
[event.event_id] of different type, current_type [long], merged_type
[string]]}]","status":400}
At this point I set ignore_conflicts=true and executed the update mapping
(via curl). I received an acknowledgment, but the mapping is not executed.
{"ok":true,"acknowledged":true}
No errors appear in the log. I used used (abused?) ignore_conflicts in the
past with success, but I am not surprised it does not work in every case.
What are the cases were an update to a mapping simply is not possible?
My next question is for reindexing recipes, but that is for a different
thread.
You can't change the type of a field mapped, even when ignore_conflicts is
set to true. Ignore conflicts simply does that, ignore the conflicts and
applies what it can, it does not apply conflicts.
On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic ivan@brusic.com wrote:
Using ES 0.16.2
Due to a change in the source content that I am indexing, I need to
update a field from a long to string.
The original mapping is dynamic, no explicit mapping was ever provided:
"event": {
"dynamic": "true",
"event_id": { "type": "long" },
// other fields ...
}
The field is never used and I do not care of "legacy" documents having
the correct type. Looking to change this value to a simple not_analyzed
string:
"event_id": { "type": "string", "index": "not_analyzed" }
Of course, an update mapping between types does not work:
{"error":"MergeMappingException[Merge failed with failures {[mapper
[event.event_id] of different type, current_type [long], merged_type
[string]]}]","status":400}
At this point I set ignore_conflicts=true and executed the update mapping
(via curl). I received an acknowledgment, but the mapping is not executed.
{"ok":true,"acknowledged":true}
No errors appear in the log. I used used (abused?) ignore_conflicts in
the past with success, but I am not surprised it does not work in every
case. What are the cases were an update to a mapping simply is not
possible?
My next question is for reindexing recipes, but that is for a different
thread.
You can't change the type of a field mapped, even when ignore_conflicts
is set to true. Ignore conflicts simply does that, ignore the conflicts and
applies what it can, it does not apply conflicts.
On Fri, Jul 22, 2011 at 4:06 PM, Ivan Brusic ivan@brusic.com wrote:
Using ES 0.16.2
Due to a change in the source content that I am indexing, I need to
update a field from a long to string.
The original mapping is dynamic, no explicit mapping was ever provided:
"event": {
"dynamic": "true",
"event_id": { "type": "long" },
// other fields ...
}
The field is never used and I do not care of "legacy" documents having
the correct type. Looking to change this value to a simple not_analyzed
string:
"event_id": { "type": "string", "index": "not_analyzed" }
Of course, an update mapping between types does not work:
{"error":"MergeMappingException[Merge failed with failures {[mapper
[event.event_id] of different type, current_type [long], merged_type
[string]]}]","status":400}
At this point I set ignore_conflicts=true and executed the update
mapping (via curl). I received an acknowledgment, but the mapping is not
executed.
{"ok":true,"acknowledged":true}
No errors appear in the log. I used used (abused?) ignore_conflicts in
the past with success, but I am not surprised it does not work in every
case. What are the cases were an update to a mapping simply is not
possible?
My next question is for reindexing recipes, but that is for a different
thread.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.