javascript - couchdb lucene date sort order is not working as expected -


i have couch db documents have field of lastupdatedatetime lastupdatedatetime : "2016-11-02 17:36:55", lastupdatedatetime :"2016-07-02 17:36:55", lastupdatedatetime :"2017-01-02 17:36:55",

i defined index following

   r.add(doc.lastupdatedatetime, {        field: 'lastupdatedatetime',         store: 'yes'     }); } 

then call view ......q=stage:xxxx &sort=lastupdatedatetime

now want date field sort order ascending or descending order, not work, not sure wrong? thanks

  {         "rows":         [             {                 "id": "xxxxxx",                 "fields":                 {                     "severity": "3",                     "lastupdatedatetime": "2017-01-02 17:36:55",                 },                 "sort_order":                 [                     "[35 35]"                 ]             },             {                 "id": "yyyy",                 "fields":                 {                      "lastupdatedatetime": "2016-07-29 19:07:23",                     "status": "open"                 },                 "sort_order":                 [                     "[32 39]"                 ]             },             {                 "id": "zzzzz",                 "fields":                 {                      "lastupdatedatetime": "2016-06-25 13:29:14",                  },                 "sort_order":                 [                     "[32 39]"                 ]             },             {                 "id": "ttttt",                 "fields":                 {                      "lastupdatedatetime": "2017-07-29 19:07:23",                      "status": "open"                 },                 "sort_order":                 [                     "[32 39]"                 ]             }         ],         "sort_order":         [             {                 "field": "lastupdatedatetime",                 "reverse": true,                 "type": "string"             }         ]     } 


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -