在
text字段集的映射中,
"store":"yes"
您应该能够使用字段来获取它
范例 :
put test/test/_mapping{ "properties" : { "name" : { "type" : "string","copy_to": "text"}, "text" : {"type" : "string" ,"store" :"yes"}, "subfield": { "properties": { "subsubfield": { "properties": { "subtext": { "index": "no", "type": "string", "copy_to": "text" } } } } } }}put test/test/1 { "name" : "hello", "subfield" : { "subsubfield" : [ {"subtext" : "soundgarden" }, {"subtext" : "alice in chains" }, {"subtext" : "dio" } ] }}post test/_search{ "fields": [ "text" ]}结果
{ "took": 2, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 1, "hits": [ { "_index": "test", "_type": "test", "_id": "1", "_score": 1, "fields": { "text": [ "hello", "soundgarden", "alice in chains", "dio" ] } } ] }}


