1
我想一個文本輸入字段進行排序,而我fielddate設置爲true,但它給了我總是以相同的順序彈性搜索:排序文本不起作用inspite fielddate設置爲true
這是我的映射:
"movieTitle": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "french",
"fielddata": true
}
這是我的要求
POST /0802v6/movie/_search
{
"from": 0,
"size": 10,
"min_score": 1,
"sort": [
{
"movieTitle": {
"order": "asc" //or desc
}
}
],
"_source": "movieTitle",
"query": {...}
}
不幸的是我一直wathever我設置ASC或DESC相同的結果。 我能看到的那種屬性不包含正確的字
"hits": [ {
"_index": "0802v6",
"_type": "proj",
"_id": "AVojCSjg8N13TOVDp6r2",
"_score": null,
"_source": {
"movieTitle": "12 Years a Slave"
},
"sort": [
"12"
]
},
{
"_index": "0802v6",
"_type": "proj",
"_id": "AVojCSg58N13TOVDp6pV",
"_score": null,
"_source": {
"movieTitle": "black wing has my angel"
},
"sort": [
"angel"
]
},
{
"_index": "0802v6",
"_type": "proj",
"_id": "AVojCSjg8N13TOVDp6qT",
"_score": null,
"_source": {
"movieTitle": "TO DO LIST (THE)"
},
"sort": [
"do"
]
},
{
"_index": "0802v6",
"_type": "proj",
"_id": "AVojCSo28N13TOVDp68w",
"_score": null,
"_source": {
"movieTitle": "Third Person"
},
"sort": [
"person"
]
}
]
你知道會發生什麼,以及如何解決它嗎?