Java 渗透器在弹性搜索中是什么意思/做什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21536599/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does percolator mean/do in elasticsearch?
提问by Hossein
Even though I read the documentation for Elasticsearch to understand what a percolator is. I still have difficulty understanding what it means and where it is used in simple terms. Can anyone provide me with more details?
尽管我阅读了 Elasticsearch 的文档以了解什么是渗透器。我仍然难以理解它的含义以及它在简单术语中的使用位置。任何人都可以向我提供更多详细信息吗?
采纳答案by javanna
What you usually do is index documents and get them back by querying. What the percolator allows you to do in a nutshell is index your queries and percolate documents against the indexed queries to know which queries they match. It's also called reversed search, as what you do is the opposite to what you are used to.
您通常做的是索引文档并通过查询取回它们。简而言之,过滤器允许您做的是索引您的查询并根据索引查询过滤文档以了解它们匹配哪些查询。它也称为反向搜索,因为您所做的与您习惯的相反。
There are different usecases for the percolator, the first one being any platform that stores users interests in order to send the right content to the right users as soon as it comes in.
渗透器有不同的用例,第一个是存储用户兴趣的任何平台,以便在正确的内容出现后立即将正确的内容发送给正确的用户。
For instance a user subscribes to a specific topic, and as soon as a new article for that topic comes in, a notification will be sent to the interested users. You can express the users interests as an elasticsearch query, using the query DSL, and you can register it in elasticsearch as it was a document. Every time a new article is issued, without needing to index it, you can percolate it to know which users are interested in it. At this point in time you know who needs to receive a notification containing the article link (sending the notification is not done by elasticsearch though). An additional step would also be to index the content itself but that is not required.
例如,用户订阅了一个特定的主题,一旦该主题的新文章出现,就会向感兴趣的用户发送通知。您可以使用查询 DSL将用户兴趣表达为 elasticsearch 查询,并且您可以将其注册在 elasticsearch 中,因为它是一个文档。每次发布新文章时,无需索引,您可以对其进行过滤以了解哪些用户对其感兴趣。此时您知道谁需要接收包含文章链接的通知(尽管发送通知不是由 elasticsearch 完成的)。一个额外的步骤也是索引内容本身,但这不是必需的。
Have a look at this presentationto see other couple of usecases and other features available in combination with the percolator starting from elasticsearch 1.0.
看看这个演示文稿,看看其他几个用例和其他功能与从 elasticsearch 1.0 开始的 percolator 结合使用。
回答by avr
In Simple terms percolator
does this:
简单来说percolator
是这样的:
User:Hey Percolator! How can you help me?
用户:嘿 Percolator!你怎么能帮我?
Percolator:Hai User! I can help you to get the alerts of your interests.
渗滤器:海用户!我可以帮助您获取您感兴趣的警报。
User:That's great! What should I do next?
用户:太好了!我接下来该怎么做?
Percolator:Please let me know your interests in the form of queries indexed in Elasticsearch.
Percolator:请以 Elasticsearch 中索引的查询形式告诉我您的兴趣。
User:I've prepared all my interests as queries and indexed them into Elasticsearch. Is it that simple?
用户:我已经准备好所有我感兴趣的查询并将它们索引到 Elasticsearch 中。有那么简单吗?
Percolator:Yes! It is that simple! I'll watch all incoming documents and get back to you with documents if they matches with any of your interests(queries)!
过滤器:是的!就是这么简单!我会查看所有收到的文件,如果文件符合您的任何兴趣(查询),我会回复您!
User:That's awesome! I'm just curious and want to know that how can you figure out which documents match with my interests.
网友:厉害了!我只是好奇,想知道您如何确定哪些文件符合我的兴趣。
Percolator:That's a good question! Answer for that is very simple! You had indexed your interests as queries into Elasticsearch right? I use them and run all those(not exactly all but for simplicity let's assume all) queries against incoming documents(these docs need not to be indexed and could be just sent for percolation!). In fact this process is called percolation! If any document matches with any of your queries then I'll send that result to the client(It could be you also)!
Percolator:这是个好问题!答案很简单!您已将您的兴趣作为查询索引到 Elasticsearch 中,对吗?我使用它们并运行所有那些(不是全部,但为了简单起见,让我们假设所有)对传入文档的查询(这些文档不需要被索引,可以只发送进行渗透!)。事实上,这个过程叫做渗透!如果任何文件与您的任何查询匹配,那么我会将结果发送给客户(也可能是您)!