简体   繁体   English

过滤器对弹性搜索的意义/做什么?

[英]What does percolator mean/do in elasticsearch?

Even though I read the documentation for Elasticsearch to understand what a percolator is. 尽管我阅读了Elasticsearch的文档,以了解过滤器是什么。 I still have difficulty understanding what it means and where it is used in simple terms. 我仍然难以理解它的含义以及简单使用的地方。 Can anyone provide me with more details? 任何人都可以向我提供更多细节吗?

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. percolator允许您简单地做的是索引您的查询并根据索引查询渗透文档以了解它们匹配的查询。 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. 您可以使用查询DSL将用户兴趣表示为elasticsearch查询,您可以将其注册在elasticsearch中,因为它是一个文档。 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). 此时您知道谁需要接收包含文章链接的通知(尽管发送通知不是由elasticsearch完成的)。 An additional step would also be to index the content itself but that is not required. 另外一个步骤也是索引内容本身,但这不是必需的。

Have a look at this presentation to see other couple of usecases and other features available in combination with the percolator starting from elasticsearch 1.0. 看一下这个演示文稿 ,从elasticsearch 1.0开始,看看其他几个用例和其他功能与过滤器结合使用。

In Simple terms percolator does this: 简单来说, percolator器可以做到这一点:

User: Hey Percolator! 用户:嘿Percolator! How can you help me? 你怎么能帮帮我?

Percolator: Hai User! 过滤器: Hai用户! 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. 用户:我已将我的所有兴趣都准备好作为查询并将其编入索引到Elasticsearch。 Is it that simple? 这么简单吗?

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? 您已将自己的兴趣编入索引到Elasticsearch吗? 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)! 如果任何文档与您的任何查询匹配,那么我会将结果发送给客户(也可能是您)!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM