Hi - In ElasticSearch 0.19.4, if we issue a search request via the Java
API against an empty index with a sort field specified, eg
searchSourceBuilder.sort("foo"), an error is returned:
...Parse Failure [No mapping found for [foo] in order to sort on]]...
Since by definition an empty index will return an empty result set, it
should not be necessary to sort it? It may be better to simply return the
empty result set in this case - having to deal with the empty index case
complicates our client code, especially in tests, where we create the index
at startup and issue search requests against the empty index which we
expect to return an empty result set.
To be honest, I am not sure whats the best solution here for an empty
index. The fact that the index does not have data does not mean that it
does not possibly have mappings defined..., and a failure should occur in
cases where you try and sort on a field that does not exists unless you
explicitly state otherwise...
On Thu, May 31, 2012 at 11:38 PM, Michael Snell michael@snell.com wrote:
Hi - ignore_unmapped is useful, but it shouldn't be necessary to specify
this option since:
a) an empty result set does not need to be sorted
b) an empty index will always return an empty result set
so it's really an optimization to ignore the query (and sort field)
entirely when searching an empty index, and simply return an empty result
set.
On Wednesday, 30 May 2012 12:02:26 UTC+1, Wojciech Durczyński wrote:
Awesome
How could I missed it from the changelog? Thank you very much.
W dniu środa, 30 maja 2012 00:26:05 UTC+2 użytkownik kimchy napisał:
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.