13.multi_search_api
生活随笔
收集整理的這篇文章主要介紹了
13.multi_search_api
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
感覺這個multi search API好像沒有啥作用,就是可以同時發起好多search,但是使用的時候感覺作用不大
GET twitter/_msearch {} {"query" : {"match_all" : {}}, "from" : 0, "size" : 10} {} {"query" : {"match_all" : {}}} {"index" : "twitter2"} # 這個是說明下面的search針對的是twitter2 這個index {"query" : {"match_all" : {}}}可以使用template
POST /_scripts/my_template_1 {"script": {"lang": "mustache","source": {"query": {"match": {"message": "{{query_string}}"}}}} }POST /_scripts/my_template_2 {"script": {"lang": "mustache","source": {"query": {"term": {"{{field}}": "{{value}}"}}}} } GET _msearch/template {"index" : "main"} { "id": "my_template_1", "params": { "query_string": "some message" } } {"index" : "main"} { "id": "my_template_2", "params": { "field": "user", "value": "test" } }總結
以上是生活随笔為你收集整理的13.multi_search_api的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 12.suggest_type
- 下一篇: 14.count-api