Im facing situation where i cant use all the fileds which are inside this nested data type field of type nested....
So can you confirm me its better mapping objects with Maximum 1 element [{}] as an object (default mapping), and use only nested data type for fields which ve more than 1 elements?? [{},{},{},...]
Im thinking querys this Index from Java services...
One other alternative option that might work for you is to flatten the data structure of your nested documents before indexing them into Elasticsearch. The method of how the data is flattened is up to you, but you can maintain a reference of flattened documents to the original nested document using the the join field.
Elasticsearch also provides a flattened data type that can be used to flatten the data. Using that, a nested object will be mapped as a single field. To visualize fields mapped as flattened, you can use Runtime Fields to define fields you need for specific use.
For more on the flattened type and Runtime Fields, see:
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.