<p dir="auto">It'd be schway if we had a geodistance query that works between two points, ie show me the distance between <code class="notranslate">33.8688° S, 151.2093°</code> and <code class="notranslate">41.3851° N, 2.1734° E</code>.</p>
<p dir="auto">Inspired by <a href="https://discuss.elastic.co/t/json-array-of-geo-locations-get-distance-of-all-the-location-in-json-array-of-a-document/55974" rel="nofollow">this</a> forum post.</p>
<p dir="auto">AbstractCompoundWordTokenFilterFactory stores the word list as Set, but in Lucene, CompoundWordTokenFilterBase checks whether the dictionary is a CharArraySet, and if it's not, creates a new CharArraySet instance and populates it with the words from the input collection. This causes each TokenFilter to store a duplicate version of the dictionary in-memory.</p>
<p dir="auto">The net effect is that ES ends up using a lot more memory than needed when using decompounding.</p>
<p dir="auto">For a reproducible example, see <a href="https://gist.github.com/93e84d4fc412ae16d899">https://gist.github.com/93e84d4fc412ae16d899</a>, which fails if ES_MAX_MEM=1g, but works when ES_MAX_MEM=2g (on linux).</p>