【发布时间】:2015-07-22 16:54:27
【问题描述】:
当我对这样的索引执行查询时:
{
"_source":["bar"] , "size":100,
"query": {
"match_all": {}
},
"filter": {
"type" : {
"value" : "foo"
}
}
}
响应包括索引、类型等。但我已经知道索引和类型,因为我指定了它。这些信息只会增加 json 数据的大小。有没有办法从响应中排除这些?
这是我得到的:
{
"took": 31,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 364024,
"max_score": 1,
"hits": [
{
"_index": "foo_bar",
"_type": "foo",
"_id": "asdjj123123",
"_score": 1,
"_source": {
"bar": "blablablabla"
}
}
,...
我想要的是这样的,所以没有type,score,index的回复:
{
"took": 31,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 364024,
"max_score": 1,
"hits": [
{
"_id": "asdjj123123",
"_source": {
"bar": "blablablabla"
}
}
,...
【问题讨论】:
标签: json elasticsearch