Nilesh Wagh
Nilesh Wagh

Reputation: 940

ElasticSearch1.5 : Add new field in existing working Index

I have an existing index named as "MyIndex", which I am using to store a kind of data in ElasticSearch. That same index has millions of records. I am using ElasticSearch 1.5 version. Now I have a new requirement for which I want to add two more fields in the same document which I am storing in "MyIndex" Index. Now I want to use both new schema and old schema documents in future.

What Can I do? Can I inset new document in the same Index? Are we need some changes in ElasticSearch mapping? If we don't change anything, Is it affect on existing search capability?

Please help me to conclude this issue with your opinions.

Thanks in advance.

Upvotes: 1

Views: 112

Answers (1)

Alex Ott
Alex Ott

Reputation: 87144

You can add new fields to existing index by updating mapping, but in many cases it would be just ok to index documents with new fields directly, and let ES infer types (although not always recommended) - but this will depend on what type of data you're indexing, and do you need special analyzers for strings or not.

Upvotes: 1

Related Questions