2016-10-20 9 views
0

内のすべてのフィールドを取得する:これまでのところ、成功せずが<a href="https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-request-fields.html#search-request-fields" rel="nofollow">documentation of ElasticSearch 1.7</a>による弾性1.7

{ 
    "fields" : ["*"], 
    "query" : { 
     "term" : { "user" : "kimchy" } 
    } 
} 

したがって
Fields: Allows to selectively load specific stored fields for 
     each document represented by a search hit. 

{ 
    "fields" : ["user", "postDate"], 
    "query" : { 
     "term" : { "user" : "kimchy" } 
    } 
} 

* can be used to load all stored fields from the document. 

、私はすべてのフィールドを取得するには、以下を試してみました。

+0

を削除します。 '_source'フィールドにすべてのフィールドがあります。 – Val

答えて

0

だけでは、すべてのフィールドを取得したい場合は、あなたが何かを指定する必要はありませんフィールド

{ 
    "query" : { 
     "term" : { "user" : "kimchy" } 
    } 
} 
+0

これはフルセットを返しますが、 '_source'の下に深くネストされます。私はフィールドのサブセットを選択したとき、つまりフィールドを 'fields'の下に置くときと同じ結果フォーマットを望みます。これはドキュメンテーションによると思われますが、これまでのところ私はどのように考え出していません。 – mitchus

+0

次に、パラメータ_search?filter_path = hits.hits._sourceを追加するだけです –

関連する問題