Hi all,
I need to change the mapping on one of my fields. It is currently an
integer and I need it to be a string.
Ideally, I would be able to just change the type. But the documentation
says that I cannot do that (unless that has changed in the last year, I
think all the articles I read were at least a year old).
The next best suggestion I liked was changing the mapping to be a multi
field. So I did the following:
curl -XPUT 'http://localhost:9200/myIndex/myType/_mapping' -d
'{"myType":{"properties":{"copyrightYear":{"type":"multi_field","fields":{"copyrightYear":{"type":"integer"},"textual":{"type":"string"}}}}}}'
But the result is:
curl -XGET 'http://localhost:9200/myIndex/_mapping/myType'
{"myIndex":{"mappings":{"myType":{"index_analyzer":"indexAnalyzer","search_analyzer":"searchAnalyzer","_boost":{"null_value":1.0},"properties":{"isInitialized":{"type":"string"},,"copyrightYear":{"type":"integer","fields":{"copyrightYear":{"type":"integer"},"textual":{"type":"string"}}}
The issue is that when I try to add a document that has copyrightYear =
'2013/2014' for example, I get an error:
Error in one or more bulk request actions:
index: /myIndex/myType/73148865 caused MapperParsingException[failed to
parse [copyright.copyrightYear]]; nested: NumberFormatException[For input
string: "2013/2014"];
Note that the adding uses the Elastica client but the error is due to the
mapping. Is there a better approach to this problem? I don't really want to
reindex all the things because I have about 22 million records.
Thanks!
Brian Lamb
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8adc6f39-85bd-4610-b354-8457b77b8cfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.