型マッピング
{
"pois-en": {
"mappings": {
"poi": {
"properties": {
"address": {
"type": "string",
"analyzer": "portuguese"
},
"city": {
"type": "integer"
},
(...)
"type": {
"type": "integer"
}
}
}
}
}
}
すべてを照会:
GET pois-en/_search
{
"query":{
"match_all":{}
},
"fields": ["city"]
}
戻り値:
"hits": [
{
"_index": "pois-en",
"_type": "pois_poi",
"_id": "491",
"_score": 1,
"fields": {
"city": [
91
]
}
},
(...)
しかし、次を使用してフィルタリングすると:
GET pois-en/_search
{
"query" : {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"term" : {
"city" : 91
}
}
}
}
}
そのリターンは何もありません!
何が間違っているのかわかりません。Django と Elasticsearch の通信には、私は Elasticutils ( https://github.com/mozilla/elasticutils ) ですが、現在は Sense を使用してこれらのクエリを作成しています。
前もって感謝します