简体   繁体   English

使用PHP在Mongodb查询结果集上执行Elasticsearch

[英]Perform Elasticsearch on Mongodb query Result Set using PHP

I'm new bie to Elasticsearch. 我是Elasticsearch的新手。 is it possible to perform Elasticsearch on a mongodb result set? 是否可以对mongodb结果集执行Elasticsearch?

Scenario: Suppose i've a mongodb query which returned a result set of 20k, from this 20k i want to extract some results using Elasticsearch. 场景:假设我有一个mongodb查询,该查询返回了20k的结果集,我想从这20k中使用Elasticsearch提取一些结果。 BTW i'm using Elasticsearch-PHP. 顺便说一句,我正在使用Elasticsearch-PHP。

Please help me on this. 请帮我。

Thanks. 谢谢。

I do not think so in the way you specified. 我不以您指定的方式这样认为。 Elasticsearch does processing when it indexes documents to allow for future searching. Elasticsearch在索引文档以进行以后的搜索时会进行处理。 Meaning if you know you're going to be sorting on a field using a filter later on, you will index that particular field without doing any analysis on it. 这意味着,如果您知道以后将使用过滤器对某个字段进行排序,则无需对该字段进行任何分析就可以对该特定字段建立索引。

Since these pre-processed documents are what elasticsearch does its searches over, not raw text (or JSON in your case), I'm pretty sure you're going to have to index your documents in elasticsearch before you can use elasticsearch queries to search them. 由于这些经过预处理的文档是Elasticsearch进行搜索的对象,而不是原始文本(或您的情况下的JSON),因此,我很确定您必须先在Elasticsearch中对文档进行索引,然后才能使用Elasticsearch查询进行搜索他们。

Elasticsearch is storage as much as it is a query language. Elasticsearch的存储量与查询语言一样多。

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

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