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.
You can check if a query document exists for percolation using .DocumentExists<T>() or .DocumentExistsAsync<T>()
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.