Strange sort behaviour, values replaced


(DH) #1

Hello everyone.

Yesterday, I noticed a strange behaviour in the sorting of the data, in one
of my clusters.
I have a request like this :

{
"size" : 25,
"query" : {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"and" : {
"filters" : [{
"and" : {
"filters" : [{
"range" : {
"myDateField" : {
"from" : "2013-09-26",
"to" : "2014-01-27",
"include_lower" : true,
"include_upper" : true
}
}
}
]
}
}
]
}
}
}
},
"fields" : ["fieldToSortOn1",
"fieldToSortOn2",
],
"sort" : [{
"fieldToSortOn1" : {
"asc"
}
}, {
"fieldToSortOn1" : {
"asc"
}
}
]
}

So, as you see, I ask for two fields, and I request the results to be
sorted by those fields.

The problem is that I get results like these :

{
_index: myIndex
_type: myType
_id: 5454245454146
_score: null
fields: {
fieldToSortOn1: 13207580
fieldToSortOn2: 1
}
sort: [
13207580
9223372036854776000
]
}

The "fields" part is ok, I indeed get the values present in my index. But
es didn't use the value of the second field to sort, it used that big
number instead, and so, the result is threw at the end and the sort is all
wrong. It doesn't happen to all the documents, but it happens enougn to be
a serious issue (I'd say a sixth of the docs seems to be affected).
By luck, this is happening on the development environmentI have the exact
same index on my production environment, and there, I do not have any
problems.

Prior to this, we had a problem, on this cluster. A human error caused that
cluster to lose a bunch of shards. We deleted the indices with missing
shards and kept those who were complete. That indice was, of course, kept,
as it was still complete. in the end, we got back a green state and could
issue queries.

Can that strange sort behavior be linked to that problem, as I suspect? If
so, thats a real problem. Indeed, the cluster says that everything is fine
(green state) but the sort is broken. If that were to happen in production,
we would be in a world of pain and misery.
Did that happens to anyone else?
Any help would be welcome.
Thanks,
Deny

--
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/55b3ed1e-d451-4f91-b91c-a3c1dddd2bc9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(DH) #2

Sorry, I couldn't find a way to edit my first post.
I made a typo. Of course in the query, the sort is :

"sort" : [{
"fieldToSortOn1" : {
"asc"
}
}, {
"fieldToSortOn2" : {
"asc"
}
}
]

So that is not the problem.

--
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/2f36d2c8-b4cc-49b9-ba9a-e36272743f0d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3