can't get sorting working on date and geo_location

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

can't get sorting working on date and geo_location

xrado
this is my mapping
"test" : {
      "properties" : {
        "model" : {
          "index" : "not_analyzed",
          "type" : "string"
        },
        "expires" : {
          "null_value" : "-1",
          "format" : "yyyy-MM-dd HH:mm:ss",
          "type" : "date"
        },
        "location" : {
          "type" : "geo_point"
        },
        "subject" : {
          "type" : "string"
        },
        "description" : {
          "type" : "string"
        },
        "class" : {
          "index" : "not_analyzed",
          "type" : "string"
        },
        "date" : {
          "format" : "yyyy-MM-dd HH:mm:ss",
          "type" : "date"
        },
        "cid" : {
          "index" : "not_analyzed",
          "type" : "string"
        },
        "country" : {
          "index" : "not_analyzed",
          "type" : "string"
        }
      }
    }

sorting by _id works, but by date and expired I get the same results with asc and desc,
same with _geo_distance sort on location

any idea what I'm doing wrong?



Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

kimchy
Administrator
gist a recreation.

On Wednesday, June 8, 2011 at 1:43 PM, xrado wrote:

this is my mapping
"test" : {
"properties" : {
"model" : {
""index" : "not_analyzed",
"type" : "string"
},
"expires" : {
"null_value" : "-1",
"format" : "yyyy-MM-dd HH:mm:ss",
"type" : "date"
},
"location" : {
"type" : "geo_point"
},
"subject" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"class" : {
"index" : "not_analyzed",
"type" : "string"
},
"date" : {
"format" : "yyyy-MM-dd HH:mm:ss",
"type" : "date"
}},
"cid" : {
"index" : "not_analyzed",
"type" : "string"
},
""country" : {
"index" : "not_analyzed",
"type" : "string"
}
}
}

sorting by _id works, but by date and expired I get the same results with
asc and desc,
same with _geo_distance sort on location

any idea what I'm doing wrong?





--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/can-t-get-sorting-working-on-date-and-geo-location-tp3038561p3038561.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

xrado
date sorting https://gist.github.com/1014273

(geo_distance started working)
Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

kimchy
Administrator
Whats not working exactly in your gist? Things seem to work well for me, but you did not say what does not work... :)

On Wednesday, June 8, 2011 at 2:48 PM, xrado wrote:

date sorting https://gist.github.com/1014273

(geo_distance started working)

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/can-t-get-sorting-working-on-date-and-geo-location-tp3038561p3038727.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

xrado
try switching sorting order on date ("sort":{"date":"asc"}) or expires ( "sort":{"expires":"asc") asc/desc,
not sorting, returns the same result https://gist.github.com/1014273
Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

thnguyen
Sorry just testing if I can reply to posts.
Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

Ludovic Levesque
In reply to this post by xrado
Hi,

I just tested on a 0.16.2 cluster, and for dates asc/desc, results are
the same, but it's normal, date values are the same in both docs
"2011-06-08 10:30:09", sort value: 1307529009000

For expires asc/desc, I have correct results, see
https://gist.github.com/1014273#comments and sort values: -1 and
1307701809000

Ludo

On Wed, Jun 8, 2011 at 8:15 PM, xrado <[hidden email]> wrote:
> try switching sorting order on date ("sort":{"date":"asc"}) or expires (
> "sort":{"expires":"asc") asc/desc,
> not sorting, returns the same result https://gist.github.com/1014273
>
> --
> View this message in context: http://elasticsearch-users.115913.n3.nabble.com/can-t-get-sorting-working-on-date-and-geo-location-tp3038561p3040193.html
> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: can't get sorting working on date and geo_location

xrado
i guess then is my messy data, need to look closer, thx to all for now
Reply | Threaded
Open this post in threaded view
|

Monster Beats Headphone

fashionalwallet
Banned User
This post was updated on .
In reply to this post by xrado
CONTENTS DELETED
The author has deleted this message.