# Additional parameters (not related to query) with Java API

**URL:** <https://discuss.elastic.co/t/additional-parameters-not-related-to-query-with-java-api/9027>\
**Category:** Elasticsearch\
**Created:** [September 14, 2012, 8:50pm UTC](https://discuss.elastic.co/t/additional-parameters-not-related-to-query-with-java-api/9027 "2012-09-14T20:50:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [September 14, 2012, 8:50pm UTC](https://discuss.elastic.co/t/additional-parameters-not-related-to-query-with-java-api/9027/1 "2012-09-14T20:50:41Z")

</div>

Hello!

I have a question - is it possible to add parameters using ES  
Java API such that they won't be causing queries to be failing  
because of parsing ? For example, using HTTP REST api call I can do  
the following:

curl 'localhost:9200/test/\_search?pretty=true&myParam=12345' -d 'QUERY\_BODY'

And even though ES doesn't know anything about 'myParam' it won't  
complain.

Is this possible to do with Java API ?

--  
Regards,  
Rafał Kuć  
Sematext :: [http://sematext.com/](http://sematext.com/) :: Solr - Lucene - Nutch - ElasticSearch

--

---

<div class="post-metadata">

**Author:** ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)\
**Post date:** [September 19, 2012, 2:02pm UTC](https://discuss.elastic.co/t/additional-parameters-not-related-to-query-with-java-api/9027/2 "2012-09-19T14:02:00Z")

</div>

Hello,

Would it be useful for anyone (except me) if I would provide a patch with  
modification that allows to pass additional parameters along with the  
requests ? For example one could send the following:

{  
"from" : 0,  
"size" : 60,  
"query" : {  
"term" : {  
"name" : "value"  
}  
},  
"additional" : {  
"token" : "56789",  
"userId" : "12345"  
}  
}

Regards  
Rafał

W dniu piątek, 14 września 2012 22:50:47 UTC+2 użytkownik Rafał Kuć napisał:

> Hello!
> 
> I have a question - is it possible to add parameters using ES  
> Java API such that they won't be causing queries to be failing  
> because of parsing ? For example, using HTTP REST api call I can do  
> the following:
> 
> curl 'localhost:9200/test/\_search?pretty=true&myParam=12345' -d  
> 'QUERY\_BODY'
> 
> And even though ES doesn't know anything about 'myParam' it won't  
> complain.
> 
> Is this possible to do with Java API ?
> 
> --  
> Regards,  
> Rafał Kuć  
> Sematext :: [http://sematext.com/](http://sematext.com/) :: Solr - Lucene - Nutch -  
> Elasticsearch

--

---

<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, 3:12am UTC](https://discuss.elastic.co/t/additional-parameters-not-related-to-query-with-java-api/9027/3 "2017-07-06T03:12:19Z")

</div>


