我是弹性搜索的新手,我正在尝试在官方网页上遵循一些基本示例。我使用以下映射创建了一个简单的索引:
curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
{
"tweet" : {
"properties" : {
"message" : {"type" : "string", "index": "not_analyzed" },
"user" : {"type" : "string", "index": "not_analyzed" }
}
}
}'
然后我放了一些这样的数据:
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
user: "avoidness",
message : "hey elasticsearch!"
}'
在 Kibana 中,当我搜索放入索引的数据时,似乎一切正常 - 除了表格面板。即使所有其他面板都正确显示搜索结果,它也始终显示一个空表,其中包含“0 到 0 的 0 可用于分页”。我正在使用 ES v1.0.0 和 Kibana v3.0.0 里程碑 5。
表格面板上还有一个带有 curl 查询的检查框架,所以我尝试从终端运行它,它似乎工作正常,这就是它返回的内容:
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : null,
"hits" : [ {
"_index" : "twitter",
"_type" : "tweet",
"_id" : "2",
"_score" : null, "_source" : {
user: "avoidness",
message : "hey hou"
},
"sort" : [ "2" ]
}, {
"_index" : "twitter",
"_type" : "tweet",
"_id" : "1",
"_score" : null, "_source" : {
user: "avoidness",
message : "hey elasticsearch!"
},
"sort" : [ "1" ]
} ]
}
}
你知道为什么我仍然得到一张空桌子吗?