# Java API - Passing a List of Query for a prepared Search

**URL:** <https://discuss.elastic.co/t/java-api-passing-a-list-of-query-for-a-prepared-search/102659>\
**Category:** Elasticsearch\
**Created:** [October 4, 2017, 8:19am UTC](https://discuss.elastic.co/t/java-api-passing-a-list-of-query-for-a-prepared-search/102659 "2017-10-04T08:19:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgl](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@kgl](https://discuss.elastic.co/u/kgl)\
**Post date:** [October 4, 2017, 8:19am UTC](https://discuss.elastic.co/t/java-api-passing-a-list-of-query-for-a-prepared-search/102659/1 "2017-10-04T08:19:32Z")

</div>

Hey there!

I would like to write a function in Java to pass the index along with the desired queries.

What I had in mind was the following:

public SearchResponse fetchResultSetForIndex(String index, List\<AbstractQueryBuilder\<AbstractQueryBuilder\>\> queries) { /\* Stuff to do \*/}

though this does not work since Eclipse reports "QB cannot be resolved to a type" and I can't figure it out right now...

Am I missing something obvious right there?

Thanks in advance for all the help!

---

<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:** [November 1, 2017, 8:20am UTC](https://discuss.elastic.co/t/java-api-passing-a-list-of-query-for-a-prepared-search/102659/2 "2017-11-01T08:20:28Z")

</div>

Closed on November 1, 2017, 8:20am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
