Hi,
As you know, when I leave id generation to elasticsearch it provides some
unique strings to my entries like "FRS94Gd3SL-DCjYE9ld-7Q", "
-k5EX5ENRMSOQZSYj-xXRw", etc. Searching with id with the following query is
ok:
_id:FRS94Gd3SL-DCjYE9ld-7Q
But when an id starts with a minus sign elasticsearch throws a null pointer
exception:
_id:-k5EX5ENRMSOQZSYj-xXRw
Here is the exception:
{
error: "SearchPhaseExecutionException[Failed to execute phase [query],
total failure; shardFailures {null:
ArrayIndexOutOfBoundsException[57]}{null:
ArrayIndexOutOfBoundsException[57]}{null:
ArrayIndexOutOfBoundsException[57]}{null:
ArrayIndexOutOfBoundsException[57]}{null:
ArrayIndexOutOfBoundsException[57]}]"
Yea, that failure is ugly..., I fixed it to have the proper Lucene query
parsing failure (which is waaay too detailed ).
The id generation in elasticsearch has changed, it is still a 128 UUID
generation, but it is encoded using baset64 (modified to be URL friendly).
Was thinking long on which encoding should be used instead of how it was
represented before (which is waay too verbose and too long), and thought
that base64 (modified to be URL friendly) is the best choice. Is more than
open to other ideas if someone has them (for UUID based representation, I
know that generating unique ids can be done in other ways).
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.