hdvyas007
(hdvyas007)
November 23, 2012, 9:41am
1
Hi,
I can not get how to use multi search API in elastic search.
I am creating following HttpGet request.
URL : http://localhost:9200/_msearch
Body of HttpGet Request
{"index" : "test"}
{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}
{"index" : "test", "search_type" : "count"}
{"query" : {"match_all" : {}}}
{}
{"query" : {"match_all" : {}}}
{"query" : {"match_all" : {}}}
{"search_type" : "count"}
{"query" : {"match_all" : {}}}
After executing above request through REST client it's giving following
error.
{"error":"Failed to derive xcontent from
org.elasticsearch.common.bytes.BytesArray@0"}
I do not know what I am doing wrong? can somebody help me?
Thank you
Hemang
--
Hiya
{"index" : "test"}
{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}
{"index" : "test", "search_type" : "count"}
{"query" : {"match_all" : {}}}
{}
{"query" : {"match_all" : {}}}
{"query" : {"match_all" : {}}}
{"search_type" : "count"}
{"query" : {"match_all" : {}}}
What are those blank lines doing there? And you're missing a {} before
the second last {"query" : {"match_all" : {}}}
This works for me:
curl -XGET localhost:9200/_msearch -d '
{"index" : "test"}
{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}
{"index" : "test", "search_type" : "count"}
{"query" : {"match_all" : {}}}
{}
{"query" : {"match_all" : {}}}
{}
{"query" : {"match_all" : {}}}
{"search_type" : "count"}
{"query" : {"match_all" : {}}}
'
clint
After executing above request through REST client it's giving
following error.
{"error":"Failed to derive xcontent from
org.elasticsearch.common.bytes.BytesArray@0"}
I do not know what I am doing wrong? can somebody help me?
Thank you
Hemang
--
--