-
查詢文章來源地址http://www.zghlxwxcb.cn/news/detail-603172.html
#默認(rèn)返回10條
GET http://127.0.0.1:9200/user_index/_search
- 條件查詢
#全值匹配
GET http://127.0.0.1:9200/user_index/_search?q=_id:532
#包含
GET http://127.0.0.1:9200/user_index/_search?q=+name:李
#不包含
GET http://127.0.0.1:9200/user_index/_search?q=-name:李
#全文搜索
GET http://127.0.0.1:9200/user_index/_search?q=李
- 指定條數(shù)
#返回指定條數(shù)
GET http://127.0.0.1:9200/user_index/_search?size=10
#指定數(shù)據(jù)的位置,一般分頁中使用
GET http://127.0.0.1:9200/user_index/_search?size=10&from=10
#組合查詢
GET http://127.0.0.1:9200/user_index/_search?q=+name:李&size=10
- 返回結(jié)果
{
"took": 35, #執(zhí)行時(shí)間,毫秒數(shù)
"timed_out": false, #查詢是否超時(shí)
"_shards": {
"total": 1, #返回條數(shù)
"successful": 1, #成功返回條數(shù)
"skipped": 0, #跳過的數(shù)據(jù)條數(shù)
"failed": 0 #失敗的數(shù)據(jù)條數(shù)
},
"hits": {
"total": {
"value": 6963, #總條數(shù)
"relation": "eq" #查詢類型,eq=equal相等
},
"max_score": 0.7731953, # 返回?cái)?shù)據(jù)中匹配最高分
"hits": [
{
"_index": "qx_user", #索引名詞
"_type": "_doc", # 索引類型
"_id": "6013584", # 數(shù)據(jù)id
"_score": 0.7731953, # 數(shù)據(jù)分?jǐn)?shù)
"_source": { #?數(shù)據(jù)內(nèi)容
...
}
}
]
}
}
文章來源:http://www.zghlxwxcb.cn/news/detail-603172.html
到了這里,關(guān)于Elasticsearch ES操作:查詢數(shù)據(jù)(全部、分頁、單條)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!