When sorting by ES's internal ID (_uid), I've noticed that the uid field is
not treated/sorted as numeric, even though ES assigns it a numeric value.
Is this by design?
When sorting by ES's internal ID (_uid), I've noticed that the uid field
is not treated/sorted as numeric, even though ES assigns it a numeric
value. Is this by design?
The _uid field contains both the _type and the _id field. Since both of
those fields aren't necessarily numeric, _uid is not numeric either. That's
why numbers are not sorted properly. Also, if you sort on the _uid field
when querying multiple types, then all the documents that belong to one of
the types will be listed, then the other type...and so on.
I would define a specific field for sorting, with proper mapping so that
it's indexed and treated as a number.
Cheers
Luca
On Friday, July 26, 2013 11:34:37 PM UTC+2, Ivan Brusic wrote:
I am not positive, but I don't believe the _uid is indexed by default (_id
is not) and therefore you will not be able to sort on it.
--
Ivan
On Fri, Jul 26, 2013 at 8:09 AM, Roy Russo <royr...@gmail.com<javascript:>
wrote:
Hello all,
When sorting by ES's internal ID (_uid), I've noticed that the uid field
is not treated/sorted as numeric, even though ES assigns it a numeric
value. Is this by design?
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
The _uid field contains both the _type and the _id field. Since both of
those fields aren't necessarily numeric, _uid is not numeric either. That's
why numbers are not sorted properly. Also, if you sort on the _uid field
when querying multiple types, then all the documents that belong to one of
the types will be listed, then the other type...and so on.
I would define a specific field for sorting, with proper mapping so that
it's indexed and treated as a number.
Cheers
Luca
On Friday, July 26, 2013 11:34:37 PM UTC+2, Ivan Brusic wrote:
I am not positive, but I don't believe the _uid is indexed by default
(_id is not) and therefore you will not be able to sort on it.
When sorting by ES's internal ID (_uid), I've noticed that the uid field
is not treated/sorted as numeric, even though ES assigns it a numeric
value. Is this by design?
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.