The documents that my application needs to index contain an ever-growing
number of arbitrary fields. Most of these fields are strings, but some are
dates or numbers. To be able to sort on these arbitrary fields, I've built
a dynamic template into my mapping:
As the number of documents and arbitrary fields grow, the dynamic template
will add fields to the mapping.
With only 1000 documents indexed, my mapping is 220 lines long. That's not
much, but after indexing 10,000 or 100,000 documents, that mapping will
grow significantly; probably upwards of 1,000 or 5,000 lines.
Are there any caveats that one should be aware of when doing this?
The mappings are compressed and not "pretty printed" internally, so you
should not care about the size of it in that regard. Many fields do mean
more memory usage Lucene wise, just something to be aware.
The documents that my application needs to index contain an ever-growing
number of arbitrary fields. Most of these fields are strings, but some are
dates or numbers. To be able to sort on these arbitrary fields, I've built
a dynamic template into my mapping: ES Dynamic Template · GitHub
As the number of documents and arbitrary fields grow, the dynamic template
will add fields to the mapping.
With only 1000 documents indexed, my mapping is 220 lines long. That's not
much, but after indexing 10,000 or 100,000 documents, that mapping will
grow significantly; probably upwards of 1,000 or 5,000 lines.
Are there any caveats that one should be aware of when doing this?
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.