We have ads and alerts, we are supposed to find matching alerts when a new ad is posted and notify them of the ad posted.
One way is
Convert alert to a query and store it in the percolator.
When a new ad is posted identify which alerts to be notified.
Second way
Store all the alerts in a index.
When a new ad is posted convert ad into a query which can be executed
on the alerts index and fetch the matching alerts.
You should use the Percolator feature for that. For what I understand of your use case, an alert should match on keywords (and/or maybe time range) and the Query DSL will allow you to write powerful and precise queries for alerts. An ad is just a content that must be analyzed, so it should be a document.
Percolating queries as well as normal search queries are executed in parallel on multiple nodes as long as the target indices have multiple shards distributed on multiple nodes. So scaling and performance should not be an issue.
Thanks tanguy for answering with patience.
if it is same both the ways why something called percolator was introduced.
What exactly are the times it yields us the best results.
I'm not saying this is the same thing, I'm saying that you may expect similar performance.
You usually index documents and execute search queries on them to retrieve matching documents. Percolator is about indexing search queries and retrieves the search queries a given document match. This is not the same thing. And in the 1st case search queries are short-live objects and documents are long-live objects (persisted). Using percolator, search queries are long-life objects (persisted) and documents are short-live objects.
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.