config子句中format設置為json
表示以JSON格式返回結果,JSON返回的結果示例如下:
{
"result":{
"searchtime":0.001, //查詢時間
"totalHits":10, //總結果數
"numHits":10, //本次返回的結果數
"coveredPercent" : 100.0, //覆蓋的分片的百分比
"items":[ //返回結果的list
{
"fields":{ //返回的字段
"normal_key":"normal_value",
"multi_key":"valuetvalue1"
},
"property":{ //Qrs插件中定義的與每個doc相關的信息,沒有定義時不用關心
"property_normal_key":"property_normal_value",
"property_multi_key":"valuetvalue1"
},
"attribute":{ //屬性字段,有attribute子句時返回
"int_key":[
1,
2
],
"double_key":[
1.1,
2.1
],
"string_key":[
"1",
"2"
],
"multi_key_attr":[
"valueu001Dvalue"
]
},
"variableValue":{ //返回序列化的變量
"variable_int_key":[
1,
2
],
"variable_double_key":[
1.1,
2.1
],
"variable_string_key":[
"1",
"2"
],
"variable_multi_key_attr":[
"valueu001Dvalue"
]
},
"sortExprValues":[ //排序分數
"1.001",
"1.002"
],
"tracerInfo":"tracer for hit" //排序trace
}
],
"facet":[ //統計信息
{
"key":"expr1",
"items":[
{
"value":"key1",
"sum":"4444",
"count":"123"
},
{
"value":"key2",
"sum":"5555",
"count":"345"
}
]
}
]
},
"errors":[ //錯誤信息
{
"code":1,
"message":"error"
}
],
"tracer":"trace infon" //請求基本的trace信息
}
文檔內容是否對您有幫助?