我有一些商店的文件,如下所示。如何才能查询到:
索引数据
curl -XPUT "localhost:9200/shops/doc/1" -H 'Content-Type: application/json' -d'
{
"id": 1,
"name": "中村 裕美子",
"furigana_name": "木村 稔",
"number_fans": 4,
"number_articles": 1,
"group_name": "有限会社 伊藤",
"location": {
"lat": 35.1284,
"lon": 137.1446
}
}
curl -XPUT "localhost:9200/shops/doc/2" -H 'Content-Type: application/json' -d'
{
"id": 2,
"name": "山田 明美",
"furigana_name": "木村 稔",
"number_fans": 3,
"number_articles": 2,
"group_name": "有限会社 佐藤",
"location": {
"lat": 35.1177,
"lon": 137.1915
}
}
curl -XPUT "localhost:9200/shops/doc/3" -H 'Content-Type: application/json' -d'
{
"id": 3,
"name": "松本 晃",
"furigana_name": "松本 裕美子",
"number_fans": 3,
"number_articles": 3,
"group_name": "株式会社 青山",
"location": {
"lat": 35.1098,
"lon": 137.4242
}
}这是我的查询,但它缺少过滤器,日语字母表字符的顺序和不确定是正确的顺序为其他。
curl -XPOST "localhost:9200/shops/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"match_all" : {}
},
"sort": [
{ "number_fans": { "order": "desc" } },
{ "number_articles": { "order": "desc" } },
{ "_geo_distance" : {
"location": {
"lat": 35.13914,
"lon": 137.18779
},
"order" : "desc",
"unit" : "km"
}
}
],
"size": 200
}提前感谢!
发布于 2018-10-10 02:24:51
对于#4,您需要按照furigana_name列进行排序,该列应该有日语字母Hiragana或Katakana。
您的示例数据似乎不正确,因为furigana_name有另一个人的kanji名称。例如,第一张唱片的名字“中村裕美子”应该有furigana_name“なかむらゆみこ”(我猜发音可能是错的)。
https://stackoverflow.com/questions/52724454
复制相似问题