I have two kind of docs there fore when indexing the sources are different. Seems some fields from one type of docs are not indexed.
Do I need to add empty fields to make equal(uniform) source from different source.
eg:
ES will create a index map based on the first document it indexes (and therefore creates the index), so the fields it stores will be based on that first insert. So based on which every doc type you send first, it will only have those fields indexed. To overcome this, what you need to do is create an index template to predefine all the expected fields and how they should be stored.
If you have dynamic mapping enabled it will still accept the second doc. However as @crickes mentions, you are better of defining a mapping ahead of time.
Thanks @crickes and @warkolm for your answers. I just read about types (document types) and thought of indexing them as different types. (real documents are bit complex than shown in the example).
Should I go ahead and index as different types ? or should I create index template?
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.