Inconsistent query results in ES


(Anurag Phadke) #1

Hello,
ES is sometimes failing to return results for a query that should in
fact return some.
For example:
http://:9200/logs/builds/_search?q=starttime:1330704266
This sometimes returns no results, and sometimes returns 1 (1 being
correct). If I further shorten the query to omit the doc_type:

http://:9200/logs/_search?q=starttime:1330704266
I always get 0 hits, even though I should get 3.
Strangely, this only seems to occur with this specific field
(starttime), which holds an integer, not a string. If I query the
same documents using another (string) field, the query always
succeeds:

http://:9200/logs/builds/_search?q=testgroup_id:1330704266-f80af377a148f1205f4f6ed9441244501b3c46a0
Why is ES failing to (sometimes) return the correct results for the
integer field?

I should note that the mapping
(http://:9200/logs/builds/_mapping) indicates starttime as
a string; is this the source of the problem? Even so, I don't
understand the inconsistency in the returned hits.

Any idea what might be happening here?

-anurag

--
Blog: http://anurag.co
Twitter: @anuragphadke (https://twitter.com/#!/anuragphadke)


(Shay Banon) #2

Is there a chance that you have starttime under several types in the same
index (builds), once as string and once as numeric? You can check that
using the get mapping API on the whole index. Also, which elasticsearch
version are you using?

On Tue, Mar 27, 2012 at 1:18 AM, Anurag anurag.phadke@gmail.com wrote:

Hello,
ES is sometimes failing to return results for a query that should in
fact return some.
For example:
http://:9200/logs/builds/_search?q=starttime:1330704266
This sometimes returns no results, and sometimes returns 1 (1 being
correct). If I further shorten the query to omit the doc_type:

http://:9200/logs/_search?q=starttime:1330704266
I always get 0 hits, even though I should get 3.
Strangely, this only seems to occur with this specific field
(starttime), which holds an integer, not a string. If I query the
same documents using another (string) field, the query always
succeeds:

http://
:9200/logs/builds/_search?q=testgroup_id:1330704266-f80af377a148f1205f4f6ed9441244501b3c46a0
Why is ES failing to (sometimes) return the correct results for the
integer field?

I should note that the mapping
(http://:9200/logs/builds/_mapping) indicates starttime as
a string; is this the source of the problem? Even so, I don't
understand the inconsistency in the returned hits.

Any idea what might be happening here?

-anurag

--
Blog: http://anurag.co
Twitter: @anuragphadke (https://twitter.com/#!/anuragphadke)


(system) #3