The order of the result doesn't work properly?

Hi all,
I don't know if anyone has the same problem with me.
I do a search using transport client and called addSort like this:
addSort("FILE_OFFSET", SortOrder.DESC)
I have three records in elasticsearch server with "FILE_OFFSET" - 340,
760, 1100.
It seems that each time I search the result, I can only find the
result with 760 as FILE_OFFSET.
Can anyone here help me with this issue?

Thanks and best regards,
Kun

Hi all,
I found that the search order is based on string.
But I want to set the search order based on long value.
Can anyone here tell me how to set the search order based on long
value instead of string value?
I'm using Java API.

Thanks and best regards,
Kun

On Aug 5, 5:00 pm, Rent a room haoniu...@gmail.com wrote:

Hi all,
I don't know if anyone has the same problem with me.
I do a search using transport client and called addSort like this:
addSort("FILE_OFFSET", SortOrder.DESC)
I have three records in elasticsearch server with "FILE_OFFSET" - 340,
760, 1100.
It seems that each time I search the result, I can only find the
result with 760 as FILE_OFFSET.
Can anyone here help me with this issue?

Thanks and best regards,
Kun

You can do it by specifying "long" type for the FILE_OFFSET field in
your index mapping. See Elasticsearch Platform — Find real-time answers at scale | Elastic
for more information.

On Aug 7, 2:33 am, kun niu haoniu...@gmail.com wrote:

Hi all,
I found that the search order is based on string.
But I want to set the search order based on long value.
Can anyone here tell me how to set the search order based on long
value instead of string value?
I'm using Java API.

Thanks and best regards,
Kun

On Aug 5, 5:00 pm, Rent a room haoniu...@gmail.com wrote:

Hi all,
I don't know if anyone has the same problem with me.
I do a search using transport client and called addSort like this:
addSort("FILE_OFFSET", SortOrder.DESC)
I have three records in elasticsearch server with "FILE_OFFSET" - 340,
760, 1100.
It seems that each time I search the result, I can only find the
result with 760 as FILE_OFFSET.
Can anyone here help me with this issue?

Thanks and best regards,
Kun

Right. I got it.
Thanks a lot.

-----Original Message-----
From: elasticsearch@googlegroups.com
[mailto:elasticsearch@googlegroups.com] On Behalf Of imotov
Sent: 2011年8月8日 4:11
To: elasticsearch
Subject: Re: The order of the result doesn't work properly?

You can do it by specifying "long" type for the FILE_OFFSET field in your index
mapping. See
Elasticsearch Platform — Find real-time answers at scale | Elastic
for more information.

On Aug 7, 2:33 am, kun niu haoniu...@gmail.com wrote:

Hi all,
I found that the search order is based on string.
But I want to set the search order based on long value.
Can anyone here tell me how to set the search order based on long
value instead of string value?
I'm using Java API.

Thanks and best regards,
Kun

On Aug 5, 5:00 pm, Rent a room haoniu...@gmail.com wrote:

Hi all,
I don't know if anyone has the same problem with me.
I do a search using transport client and called addSort like this:
addSort("FILE_OFFSET", SortOrder.DESC) I have three records in
elasticsearch server with "FILE_OFFSET" - 340, 760, 1100.
It seems that each time I search the result, I can only find the
result with 760 as FILE_OFFSET.
Can anyone here help me with this issue?

Thanks and best regards,
Kun