Not sorting by Date


(Walendo) #1

Hi,

I'm trying to sort some information by date (date desc) and it is not
working, I tried the two mappings below for the field and it didn't
work.

"dataNoticia" : {"type" : "date", "format" : "yyyy-MM-dd'T'HH:mm:ss",
"store" :"yes", "index_name" : "date", "index" : "not_analyzed",
"term_vector" : "no", "boost" : 1.0, "omit_norms" : true,
"omit_term_freq_and_positions" : true, "precision_step" : 4},

"dataNoticia" : {"type" : "date", "format" : "yyyy-MM-dd'T'HH:mm:ss",
"store" :"yes"}

The query String is as follows:

http://localhost:9200/indice/noticia_transito_cidade/_search?callback=LM16206_noticiasCidadeRetornadas&size=5&q=cidade%3D+558&sort=dataNoticia%3Areverse

Is there something I'm forgetting?

Thanks
Jorge


(Shay Banon) #2

No, this looks good. Can you open an issue and add some curls that recreate
the problem?

cheers,
shay.banon

On Fri, Apr 30, 2010 at 4:29 PM, Walendo jorge.walendowsky@gmail.comwrote:

Hi,

I'm trying to sort some information by date (date desc) and it is not
working, I tried the two mappings below for the field and it didn't
work.

"dataNoticia" : {"type" : "date", "format" : "yyyy-MM-dd'T'HH:mm:ss",
"store" :"yes", "index_name" : "date", "index" : "not_analyzed",
"term_vector" : "no", "boost" : 1.0, "omit_norms" : true,
"omit_term_freq_and_positions" : true, "precision_step" : 4},

"dataNoticia" : {"type" : "date", "format" : "yyyy-MM-dd'T'HH:mm:ss",
"store" :"yes"}

The query String is as follows:

http://localhost:9200/indice/noticia_transito_cidade/_search?callback=LM16206_noticiasCidadeRetornadas&size=5&q=cidade%3D+558&sort=dataNoticia%3Areverse

Is there something I'm forgetting?

Thanks
Jorge


(system) #3