3

秒のマッピング定義を使用:

  "time": {
           "type": "date",
           "store": "yes",
           "format": "yyyy/MM/dd HH:mm:ss",
           "index": "analyzed"
        },

時刻フィールドは「desc」と「asc」で正しくソートされます

ただし、ミリ秒の精度が必要です

  "time": {
           "type": "date",
           "store": "yes",
           "format": "yyyy/MM/dd HH:mm:ss.SSS",
           "index": "analyzed"
        },

次に、奇妙なことに、「asc」の並べ替えは並べ替え順序を返しますが、「desc」の並べ替えは正しいミリ秒の順序を返します

4

1 に答える 1