Sorting weirdness

I have a mapping like this:

    "venue": {
      "type": "nested",
      "include_in_parent": true,
      "properties": {
        "name": {
          "type": "string"
        }
      }

If I'm sorting by 'venue.name' ascending, why would a name like 'Terminal
5' be sorted before 'B.B. King Blues Club & Grill'? Does it have something
to do with the number '5' in the name?

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/159fe507-bb01-4504-9ba7-e6b7e7bb964c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Michael,

This is because your field is tokenized and elasticsearch will take the
minimum value as a sort value. For the first document, this would be "5",
which compares lower than "B" in the second string. To make it work as
expected, you need to index your field as not_analyzed (
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#string
).

On Sat, Oct 25, 2014 at 8:37 PM, Michael Irwin mdi@livej.am wrote:

I have a mapping like this:

    "venue": {
      "type": "nested",
      "include_in_parent": true,
      "properties": {
        "name": {
          "type": "string"
        }
      }

If I'm sorting by 'venue.name' ascending, why would a name like 'Terminal
5' be sorted before 'B.B. King Blues Club & Grill'? Does it have
something to do with the number '5' in the name?

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/159fe507-bb01-4504-9ba7-e6b7e7bb964c%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/159fe507-bb01-4504-9ba7-e6b7e7bb964c%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6eGjjezKR592k7_8WUf151j_CxE7aR%2BuMrB0Fgo8U-HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.