# ElasticSearch NEST 2.4 Does Percolator Exist

**URL:** <https://discuss.elastic.co/t/elasticsearch-nest-2-4-does-percolator-exist/67389>\
**Category:** Elasticsearch\
**Created:** [November 28, 2016, 7:02pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-2-4-does-percolator-exist/67389 "2016-11-28T19:02:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisFord](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisford/32/13201_2.png) [@ChrisFord](https://discuss.elastic.co/u/ChrisFord)\
**Post date:** [November 28, 2016, 7:02pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-2-4-does-percolator-exist/67389/1 "2016-11-28T19:02:53Z")

</div>

Hi All,

Is there anyway in NEST 2.4 to determine whether a percolator type exists, or get a count of the number of documents registered with the percolator?

I am building a service that if the percolator type doesn't exist then it will build up the percolator, however I do not want to run this every time for obvious reasons. Ideally I would like to compare the count of percolated queries against the expected amount, but otherwise I will just go with whether the type exists.

I have tried using the TypeExists method within the ElasticClient however this returns false, even though the .percolator type does exist and I can happily get documents from the percolator later on.

Any help would be great.

Thanks

Chris

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [November 30, 2016, 4:42am UTC](https://discuss.elastic.co/t/elasticsearch-nest-2-4-does-percolator-exist/67389/2 "2016-11-30T04:42:12Z")

</div>

You can check if a query document exists for percolation using `.DocumentExists<T>()` or `.DocumentExistsAsync<T>()`

```auto
var documentExistsResponse = this.Client.DocumentExists<object>("document-id", d => d
    .Index("index-name")
    .Type(".percolator")
);

if (documentExistsResponse.Exists)
{
    // document exists
}

```

This method can be used to check for the existence of any document type in an index.

---

<div class="post-metadata">

**Author:** ![ChrisFord](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisford/32/13201_2.png) [@ChrisFord](https://discuss.elastic.co/u/ChrisFord)\
**Post date:** [November 30, 2016, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-2-4-does-percolator-exist/67389/3 "2016-11-30T14:37:46Z")

</div>

Excellent, thanks for the help, that worked perfectly.

---

<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:** [December 28, 2016, 2:38pm UTC](https://discuss.elastic.co/t/elasticsearch-nest-2-4-does-percolator-exist/67389/4 "2016-12-28T14:38:01Z")

</div>

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