# Is it possible to pass 2 queries as params to a script

**URL:** https://discuss.elastic.co/t/is-it-possible-to-pass-2-queries-as-params-to-a-script/18580
**Category:** Elasticsearch
**Created:** [July 10, 2014, 4:08pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-2-queries-as-params-to-a-script/18580 "2014-07-10T16:08:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Adrian\_M](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Adrian\_M](https://discuss.elastic.co/u/Adrian_M)
#### Post date: [July 10, 2014, 4:08pm UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-2-queries-as-params-to-a-script/18580/1 "2014-07-10T16:08:13Z")

</div>

I want to compare the results of 2 queries.

Is it possible to do 2 queries in one go and pass the result from query 1  
as a param 1 to a script and the result from the second query as param 2 to  
the same script?

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c8d18165-eef2-409f-96bc-79f6a4803254%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c8d18165-eef2-409f-96bc-79f6a4803254%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [July 18, 2014, 9:44am UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-2-queries-as-params-to-a-script/18580/2 "2014-07-18T09:44:49Z")

</div>

Hey,

no, this should be done on the client side instead of a script in  
Elasticsearch.

--Alex

On Thu, Jul 10, 2014 at 6:08 PM, Adrian [eamocanu@gmail.com](mailto:eamocanu@gmail.com) wrote:

> I want to compare the results of 2 queries.
> 
> Is it possible to do 2 queries in one go and pass the result from query 1  
> as a param 1 to a script and the result from the second query as param 2 to  
> the same script?
> 
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/c8d18165-eef2-409f-96bc-79f6a4803254%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c8d18165-eef2-409f-96bc-79f6a4803254%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c8d18165-eef2-409f-96bc-79f6a4803254%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c8d18165-eef2-409f-96bc-79f6a4803254%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8bTr1yHQJu456HaLYSHXSebf4NxHr7tprtXk\_tu5XBCA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8bTr1yHQJu456HaLYSHXSebf4NxHr7tprtXk_tu5XBCA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:14am UTC](https://discuss.elastic.co/t/is-it-possible-to-pass-2-queries-as-params-to-a-script/18580/3 "2017-07-06T01:14:58Z")

</div>


