# Types are deprecated in percolate queries but PercolateQueryBuilder class still requires the type

**URL:** <https://discuss.elastic.co/t/types-are-deprecated-in-percolate-queries-but-percolatequerybuilder-class-still-requires-the-type/210955>\
**Category:** Elasticsearch\
**Created:** [December 7, 2019, 9:01am UTC](https://discuss.elastic.co/t/types-are-deprecated-in-percolate-queries-but-percolatequerybuilder-class-still-requires-the-type/210955 "2019-12-07T09:01:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarvar\_Nishonboyev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sarvar_nishonboyev/32/58981_2.png) [@Sarvar\_Nishonboyev](https://discuss.elastic.co/u/Sarvar_Nishonboyev)\
**Post date:** [December 7, 2019, 9:01am UTC](https://discuss.elastic.co/t/types-are-deprecated-in-percolate-queries-but-percolatequerybuilder-class-still-requires-the-type/210955/1 "2019-12-07T09:01:55Z")

</div>

I have been receiving warning messages each time my app does percolate. I'm using the 7.4.0 versions of elasticsearch and percolate clients. Elasticsearch is also at 7.4.0 version. I know types are deprecated at 7th version, but `PercolateQueryBuilder` class is still requiring `indexedDocumentType` . I have checked other constructors, but it doesn't offer a constructor to build percolate query without a type.

Warning message:

> request [POST [http://localhost:9200/saved\_searches/\_search?typed\_keys=true&ignore\_unavailable=false&expand\_wildcards=open&allow\_no\_indices=true&ignore\_throttled=true&scroll=1m&search\_type=query\_then\_fetch&batched\_reduce\_size=512&ccs\_minimize\_roundtrips=true](http://localhost:9200/saved_searches/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&scroll=1m&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true)] returned 1 warnings: [299 Elasticsearch-7.4.0-22e1767283e61a198cb4db791ea66e3f11ab9910 "[types removal] Types are deprecated in [percolate] queries. The [type] of the indexed document should no longer be specified."]

Code to run percolating job.

```auto
PercolateQueryBuilder percolateQuery = new PercolateQueryBuilder("query",
        "order", "_doc", order.getId(),
        null,
        null,
        null);
SearchRequest searchRequest = new SearchRequest("saved_search");
            SearchSourceBuilder searchSourceBuilder = SearchSourceBuilder.searchSource()
                    .storedFields(Collections.emptyList())
                    .query(constantScoreQuery(percolateQuery));
searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);

```

I can't find what I have done wrong.

---

<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:** [January 4, 2020, 9:06am UTC](https://discuss.elastic.co/t/types-are-deprecated-in-percolate-queries-but-percolatequerybuilder-class-still-requires-the-type/210955/2 "2020-01-04T09:06:48Z")

</div>

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