弹性搜索遍历两个索引的值

时间:2018-12-11 16:13:20

标签: loops elasticsearch lucene

我正在寻找一种方法,以将来自INDEX_1的字段X的值与来自INDEX_2的字段Y的值进行循环。

有人面对过/完成过这样的/类似的任务吗?

1 个答案:

答案 0 :(得分:0)

在Elastic搜索本身中,这非常容易!只要您指定索引,就可以用逗号分隔其他索引。

$router->get('/', function() use($file_path) { 
    include_once("views/$file_path"); //<-- Change this to be root page instead of the login page...
});

您还可以使用_all搜索所有索引。

curl -XGET 'http://localhost:9200/index1,index2/_search?q=yourQueryHere'

以下是elasticsearch网站上的一些有用文档。该网站有大量信息,但IMO有时很难找到。

  

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-search.html   http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/multi-index.html

相关问题