Use ElasticSearch percolator (reverse query) in Enterprise Search

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!

:wave:

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, which describes how to run percolate queries on existing documents, combined with Documents API | Elastic App Search Documentation [7.11] | Elastic, 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!

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 :slight_smile:
thank you!

Noted :smiley:

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!

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

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 :slight_smile:

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.