0
我想通過索引 - >按索引類型 - >文本搜索數據按順序在ES上搜索數據。
當我在「_index」上使用下面的查詢時,我希望得到該特定_index下的index_types列表以及相關數據,但它什麼也沒有返回。另一方面,當我用_type搜索時,我得到了有關index_type的數據。我哪裏錯了?
Elasticsearch方面:在_index上搜索沒有返回結果
curl -XGET 'http://localhost:9200/_all/_search?pretty' -d '{
"facets": {
"terms": {
"terms": {
"field": "_index",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
},
"filter": {
"bool": {
"must": [
{
"terms": {
"_index": [
"<index_name>"
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}'
注:我首先面臨這一問題上Kibana,其中I中使用的過濾器 「_index」: 「name_of_index」;它沒有返回結果,但「_type」:「name_of_index_type」返回了預期的結果。我發現Kibana在後臺使用上面的查詢來獲得我試過的過濾器的結果。
爲什麼你不指定你的索引在url? 使用「aggs」(聚合),因爲方面折舊。 – AlainIb 2014-11-21 12:49:09