# Use ElasticSearch percolator (reverse query) in Enterprise Search

**URL:** <https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301>\
**Category:** Elastic Search\
**Created:** [February 15, 2021, 11:34am UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301 "2021-02-15T11:34:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suxsem](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Suxsem](https://discuss.elastic.co/u/Suxsem)\
**Post date:** [February 15, 2021, 11:34am UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/1 "2021-02-15T11:34:35Z")

</div>

I'm VERY new to elasticsearch.

I installed elasticsearch along with enterprisesearch in order to use it to implement a search feature in my mobile app. I think it's working great.

Now, one of my requirements is to implement a "saved search" feature that allows my user to receive a push notification as soon as a new item match their saved search.

I found an awesome feature of Elasticsearch called "percolator" that implements reverse-queries and allows me to accomplish this task. However, I'm not understanding how I can use this feature in enterprisesearch.

Can you help me please? Thanks!

---

<div class="post-metadata">

**Author:** ![Scrilling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scrilling/32/78663_2.png) [@Scrilling](https://discuss.elastic.co/u/Scrilling)\
**Post date:** [February 15, 2021, 8:59pm UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/2 "2021-02-15T20:59:31Z")

</div>

👋

Enterprise Search does not currently support any out-of-the-box integration with percolate queries. If you are interested in rolling your own solution, I recommend taking a look at [Percolate query | Elasticsearch Reference [7.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-percolate-query.html#_percolating_an_existing_document), which describes how to run percolate queries on existing documents, combined with [Documents API | Elastic App Search Documentation [7.11] | Elastic](https://www.elastic.co/guide/en/app-search/current/documents.html#documents-get), which describes how to fetch existing documents from app search.

This approach would require creating a separate index for percolate queries, and using the ent-search documents api to fetch document ids.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Suxsem](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Suxsem](https://discuss.elastic.co/u/Suxsem)\
**Post date:** [February 16, 2021, 9:42am UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/3 "2021-02-16T09:42:28Z")

</div>

It helps, indeed!

I have one big problem: all my queries are built using the AppSearch query syntax, that from what i saw is slightly different from the raw ElasticSearch one.  
How can I extract the raw ElasticSearch query from an AppSearch query?

Anyway, please consider adding the percolate queries to EnterpriseSearch as well, I think more and more sites and apps are adding the "saved search" feature 🙂  
thank you!

---

<div class="post-metadata">

**Author:** ![Scrilling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scrilling/32/78663_2.png) [@Scrilling](https://discuss.elastic.co/u/Scrilling)\
**Post date:** [February 17, 2021, 3:58am UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/4 "2021-02-17T03:58:56Z")

</div>

Noted 😃

After diving a bit deeper into your use case I believe there is not a clean way to build integration with ES percolate queries at this time. I am double checking some assumptions and will get back to you tomorrow with more info in case I have missed something.

Apologies that we cannot do more!

---

<div class="post-metadata">

**Author:** ![Suxsem](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Suxsem](https://discuss.elastic.co/u/Suxsem)\
**Post date:** [February 18, 2021, 5:32pm UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/5 "2021-02-18T17:32:20Z")

</div>

hi @Scrilling thank you for your time! Any good news for me? 🙂

I'm afraid of asking, but can you recommend any other product that allows me to implement some kind of smart search like EntepriseSearch does plus a "saved search" feature that notifies users when a new item matches their search? I'm still in early phase of development so a product change could be feasible. Of course I will choose ES for future projects because I really like the product, maybe in the meantime percolate will be available in EnterpriseSearch too 🙂

---

<div class="post-metadata">

**Author:** ![Scrilling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scrilling/32/78663_2.png) [@Scrilling](https://discuss.elastic.co/u/Scrilling)\
**Post date:** [February 18, 2021, 9:48pm UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/6 "2021-02-18T21:48:07Z")

</div>

Hi @Suxsem,

No additional information on usage of percolate queries within App Search, but I do not believe that would be a blocker for building this feature. I would recommend storing a user’s saved searches in your application backend and running a cron job that regularly executes the saved searches through the App Search APIs, sending a push notification if there are new results.

I hope this helps! Please let me know if I can provide any additional information around App Search.

---

<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 4, 2022, 8:24am UTC](https://discuss.elastic.co/t/use-elasticsearch-percolator-reverse-query-in-enterprise-search/264301/7 "2022-11-04T08:24:10Z")

</div>


