我正在尝试使用Perl的Elasticsearch Percolator,我发现这个很酷的
module.
据我所知,它们只是读取方法,因此只能读取查询索引并查看查询是否已存在,计算匹配的查询等.
除非我遗漏了某些内容,否则无法通过Percolator接口添加查询,因此我所做的是使用普通方法创建针对.percolator索引的文档,如下所示:
my $e = Search::Elasticsearch->new( nodes => 'localhost:9200' ); $e->create( index => 'my_index',type => '.percolator',id => $max_idx,body => { query => { match => { ...whatever the query is.... },},);
这是通过perl模块向percolator索引添加查询的最佳方法吗?
谢谢!
解决方法
根据DrTech的回答,我发布的代码看起来是正确的做法.