2014-02-22 83 views
0

我是elasticsearch的新手,我正在嘗試關注官方網頁上的一些基本示例。我創建了一個簡單的指標有以下映射:Kibana空表問題

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可用於分頁'。我正在使用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" ] 
    } ] 
    } 
} 

你有什麼想法,爲什麼我仍然得到一個空表,請?

回答

1

TL; DR:您的輸入文檔無效JSON:它忽略了關鍵字周圍的雙引號。修復它,它會工作。

elasticsearch JSON解析器很靈活,可以解析無效的JSON,從而生成一個有效的索引。大多數kibana組件只使用索引中的數據,並且正常工作。然而,表格組件要求文檔來源:由於它是逐字存儲的,表格查詢返回的數據被它所污染,並且瀏覽器拒絕解析導致的無效JSON。

此問題也在https://github.com/elasticsearch/kibana/issues/1088#issuecomment-49405144中解決。