# Elasticsearch "should doesn't support arrays"

**URL:** <https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851>\
**Category:** Elasticsearch\
**Created:** [February 22, 2013, 12:14am UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851 "2013-02-22T00:14:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [February 22, 2013, 12:14am UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/1 "2013-02-22T00:14:38Z")

</div>

Is this a bug or a "feature" of multisearch?  
....  
I have a standard bool query with multiple should term queries. It runs  
fine. I turn that into an \_msearch and the query fails. In fact, all of the  
booleans fail with arrays. Without arrays, they work just fine.

{"error": "should doesn't support arrays"}

Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 22, 2013, 8:15am UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/2 "2013-02-22T08:15:58Z")

</div>

It's a regression in MultiSearchRequest, introduced by

> <https://github.com/elastic/elasticsearch/pull/2482>
>
> currently MultiSearchRequest requries to specify indices and types as comma sepa…rated. This PR allows specification as arrays too.

Jörg

Am 22.02.13 01:14, schrieb [jtreher@gmail.com](mailto:jtreher@gmail.com):

> Is this a bug or a "feature" of multisearch?  
> ....  
> I have a standard bool query with multiple should term queries. It  
> runs fine. I turn that into an \_msearch and the query fails. In fact,  
> all of the booleans fail with arrays. Without arrays, they work just fine.
> 
> {"error": "should doesn't support arrays"}
> 
> ## Thanks!
> 
> You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 22, 2013, 10:55am UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/3 "2013-02-22T10:55:21Z")

</div>

On Fri, 2013-02-22 at 09:15 +0100, Jörg Prante wrote:

> It's a regression in MultiSearchRequest, introduced by  
> [allow index and type to be specified as arrays in MultiSearchRequest by s1monw · Pull Request #2482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/2482)

Actually, I don't think it is.

I think the OP placed the query in the wrong line of the multi-search  
request.

This works for me:

curl -XGET '[http://127.0.0.1:9200/test/test/\_msearch?pretty=1](http://127.0.0.1:9200/test/test/_msearch?pretty=1)' -d '  
{}  
{"query" : {"bool" : {"should" : [{"term" : {"foo" : "bar"}}, {"term" : {"foo" : "baz"}}]}}}  
'

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [February 22, 2013, 12:51pm UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/4 "2013-02-22T12:51:56Z")

</div>

Clinton,

My query is the same format as yours as far as I know.

If i remove the array and make it a single term, I get the normal query  
union as you would expect. This is version .20.5

On Friday, February 22, 2013 5:55:21 AM UTC-5, Clinton Gormley wrote:

> On Fri, 2013-02-22 at 09:15 +0100, Jörg Prante wrote:
> 
> > It's a regression in MultiSearchRequest, introduced by  
> > [allow index and type to be specified as arrays in MultiSearchRequest by s1monw · Pull Request #2482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/2482)
> 
> Actually, I don't think it is.
> 
> I think the OP placed the query in the wrong line of the multi-search  
> request.
> 
> This works for me:
> 
> curl -XGET '[http://127.0.0.1:9200/test/test/\_msearch?pretty=1](http://127.0.0.1:9200/test/test/_msearch?pretty=1)' -d '  
> {}  
> {"query" : {"bool" : {"should" : [{"term" : {"foo" : "bar"}}, {"term" :  
> {"foo" : "baz"}}]}}}  
> '
> 
> clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 22, 2013, 8:15pm UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/5 "2013-02-22T20:15:41Z")

</div>

On Fri, 2013-02-22 at 04:51 -0800, [jtreher@gmail.com](mailto:jtreher@gmail.com) wrote:

> Clinton,
> 
> My query is the same format as yours as far as I know.

Any chance you can share it? That way I can try it locally

clint

> If i remove the array and make it a single term, I get the normal  
> query union as you would expect. This is version .20.5
> 
> On Friday, February 22, 2013 5:55:21 AM UTC-5, Clinton Gormley wrote:  
> On Fri, 2013-02-22 at 09:15 +0100, Jörg Prante wrote:  
> \> It's a regression in MultiSearchRequest, introduced by  
> \> [allow index and type to be specified as arrays in MultiSearchRequest by s1monw · Pull Request #2482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/2482)  
> \>
> 
> ```
> Actually, I don't think it is. 
>     
> I think the OP placed the query in the wrong line of the
> multi-search 
> request. 
>     
> This works for me: 
>     
> curl -XGET
> 'http://127.0.0.1:9200/test/test/_msearch?pretty=1' -d ' 
> {} 
> {"query" : {"bool" : {"should" : [{"term" : {"foo" : "bar"}},
> {"term" : {"foo" : "baz"}}]}}} 
> ' 
>     
> clint 
> 
> ```
> 
> --  
> You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [February 26, 2013, 4:20pm UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/6 "2013-02-26T16:20:31Z")

</div>

Clinton,

Thanks a ton for your help verifying it was my syntax. My application was  
generating a new line above the initial {}. This seems to have causes the  
issue. It was just an oddball error since \_msearch was working as long as I  
removed the array and presented a single item.

J

On Friday, February 22, 2013 3:15:41 PM UTC-5, Clinton Gormley wrote:

> On Fri, 2013-02-22 at 04:51 -0800, [jtr...@gmail.com](mailto:jtr...@gmail.com) \<javascript:\> wrote:
> 
> > Clinton,
> > 
> > My query is the same format as yours as far as I know.
> 
> Any chance you can share it? That way I can try it locally
> 
> clint
> 
> > If i remove the array and make it a single term, I get the normal  
> > query union as you would expect. This is version .20.5
> > 
> > On Friday, February 22, 2013 5:55:21 AM UTC-5, Clinton Gormley wrote:  
> > On Fri, 2013-02-22 at 09:15 +0100, Jörg Prante wrote:  
> > \> It's a regression in MultiSearchRequest, introduced by  
> > \> [allow index and type to be specified as arrays in MultiSearchRequest by s1monw · Pull Request #2482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/2482)  
> > \>
> > 
> > ```
> > Actually, I don't think it is. 
> >     
> > I think the OP placed the query in the wrong line of the 
> > multi-search 
> > request. 
> >     
> > This works for me: 
> >     
> > curl -XGET 
> > 'http://127.0.0.1:9200/test/test/_msearch?pretty=1' -d ' 
> > {} 
> > {"query" : {"bool" : {"should" : [{"term" : {"foo" : "bar"}}, 
> > {"term" : {"foo" : "baz"}}]}}} 
> > ' 
> >     
> > clint 
> > 
> > ```
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Justin\_Treher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_treher/32/45243_2.png) [@Justin\_Treher](https://discuss.elastic.co/u/Justin_Treher)\
**Post date:** [February 26, 2013, 4:27pm UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/7 "2013-02-26T16:27:32Z")

</div>

Clinton,

I discovered that my Application logic was adding a new line above the  
initial {} which seems to have caused the error. You were correct, it was  
my syntax! Thanks for verifying. The oddball error really had me confused.

J

On Friday, February 22, 2013 3:15:41 PM UTC-5, Clinton Gormley wrote:

> On Fri, 2013-02-22 at 04:51 -0800, [jtr...@gmail.com](mailto:jtr...@gmail.com) \<javascript:\> wrote:
> 
> > Clinton,
> > 
> > My query is the same format as yours as far as I know.
> 
> Any chance you can share it? That way I can try it locally
> 
> clint
> 
> > If i remove the array and make it a single term, I get the normal  
> > query union as you would expect. This is version .20.5
> > 
> > On Friday, February 22, 2013 5:55:21 AM UTC-5, Clinton Gormley wrote:  
> > On Fri, 2013-02-22 at 09:15 +0100, Jörg Prante wrote:  
> > \> It's a regression in MultiSearchRequest, introduced by  
> > \> [allow index and type to be specified as arrays in MultiSearchRequest by s1monw · Pull Request #2482 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/pull/2482)  
> > \>
> > 
> > ```
> > Actually, I don't think it is. 
> >     
> > I think the OP placed the query in the wrong line of the 
> > multi-search 
> > request. 
> >     
> > This works for me: 
> >     
> > curl -XGET 
> > 'http://127.0.0.1:9200/test/test/_msearch?pretty=1' -d ' 
> > {} 
> > {"query" : {"bool" : {"should" : [{"term" : {"foo" : "bar"}}, 
> > {"term" : {"foo" : "baz"}}]}}} 
> > ' 
> >     
> > clint 
> > 
> > ```
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:49am UTC](https://discuss.elastic.co/t/elasticsearch-should-doesnt-support-arrays/10851/8 "2017-07-06T02:49:25Z")

</div>


