Can we perform multisearch with -d option?

Heya,

I'm working on Elasticsearch SPORE project and I'm wondering if we can perform a
msearch query using -d.

I can do _search with -d

$ curl -XPOST localhost:9200/_search -d "{"query":{"match_all":{}}}"
{"took":168,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

But I can't find a way to perform a _msearch

$ curl -XPOST localhost:9200/_msearch -d "{}{"query":{"match_all":{}}}"
{"error":"ActionRequestValidationException[Validation Failed: 1: no requests
added;]","status":500}

I'm aware that in documentation, it's stated that we have to use --data-binary
@filename form but I can't use that with spore. Is there any other way?
Perhaps, I can work on a PR that allows to do it??? What do you think gurus? :wink:

FYI, I tried this in SPORE (note the \n chars):

SporeResult result = spore.call("multi_search", new
ImmutableMap.Builder<String, String>()
.put("index", _index)
.put("type", _type)
.build(),
"{}\n{"query":{"match_all":{}}}\n");

Cheers

David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

Hi David,

Not sure if this is what you're after, but the following works:
curl -XPOST localhost:9200/_msearch -d "{}
{"query":{"match_all":{}}}
"

and this, too:

REQUEST=$'{}\n{"query":{"match_all":{}}}\n'; curl -XPOST
localhost:9200/_msearch -d "$REQUEST"

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Wed, Dec 5, 2012 at 5:24 PM, David Pilato david@pilato.fr wrote:

**
Heya,

I'm working on Elasticsearch SPORE project and I'm wondering if we can
perform a msearch query using -d.

I can do _search with -d

$ curl -XPOST localhost:9200/_search -d "{"query":{"match_all":{}}}"

{"took":168,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

But I can't find a way to perform a _msearch

$ curl -XPOST localhost:9200/_msearch -d "{}{"query":{"match_all":{}}}"
{"error":"ActionRequestValidationException[Validation Failed: 1: no
requests added;]","status":500}

I'm aware that in documentation, it's stated that we have to use
--data-binary @filename form but I can't use that with spore. Is there any
other way?
Perhaps, I can work on a PR that allows to do it??? What do you think
gurus? :wink:

FYI, I tried this in SPORE (note the \n chars):

SporeResult result = spore.call("multi_search", new
ImmutableMap.Builder<String, String>()
.put("index", _index)
.put("type", _type)
.build(),
"{}\n{"query":{"match_all":{}}}\n");

Cheers

David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

--

Thanks Radu. It works...

That's strange. I think that there is an issue with the JSpore client.
I have to check that.

Thanks again for your advices.
David.

Le 5 décembre 2012 à 17:23, Radu Gheorghe radu.gheorghe@sematext.com a écrit :

Hi David,

Not sure if this is what you're after, but the following works:
curl -XPOST localhost:9200/_msearch -d "{}
{"query":{"match_all":{}}}
"

and this, too:

REQUEST=$'{}\n{"query":{"match_all":{}}}\n'; curl -XPOST
localhost:9200/_msearch -d "$REQUEST"

Best regards,
Radu

http://sematext.com/ http://sematext.com/ -- ElasticSearch -- Solr --
Lucene

On Wed, Dec 5, 2012 at 5:24 PM, David Pilato <david@pilato.fr
mailto:david@pilato.fr > wrote:

Heya,

I'm working on Elasticsearch SPORE project and I'm wondering if we can
perform a msearch query using -d.

I can do _search with -d

$ curl -XPOST localhost:9200/_search -d "{"query":{"match_all":{}}}"

{"took":168,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

But I can't find a way to perform a _msearch

$ curl -XPOST localhost:9200/_msearch -d
"{}{"query":{"match_all":{}}}"
{"error":"ActionRequestValidationException[Validation Failed: 1: no
requests added;]","status":500}

I'm aware that in documentation, it's stated that we have to use
--data-binary @filename form but I can't use that with spore. Is there any
other way?
Perhaps, I can work on a PR that allows to do it??? What do you think
gurus? :wink:

FYI, I tried this in SPORE (note the \n chars):

SporeResult result = spore.call("multi_search", new
ImmutableMap.Builder<String, String>()
.put("index", _index)
.put("type", _type)
.build(),
"{}\n{"query":{"match_all":{}}}\n");

Cheers

David Pilato
http://www.scrutmydocs.org/ http://www.scrutmydocs.org/
http://dev.david.pilato.fr/ http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--