我正在尝试使用Perl的Elasticsearch Percolator,我找到了这个很酷的模块.
据我所知,它们只是读取方法,因此只能读取查询索引并查看查询是否已存在,计算匹配的查询等.
除非我遗漏了某些内容,否则无法通过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....
},
},
},
);
Run Code Online (Sandbox Code Playgroud)
这是通过perl模块向percolator索引添加查询的最佳方法吗?
谢谢!
openstreetmap响应中'importance'和'place_rank'字段的含义是什么?我在文档中的任何地方都找不到它:/
例如,此网址的响应:
http://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon=1&addressdetails=1
Run Code Online (Sandbox Code Playgroud)
是:
<place place_id="62311100" osm_type="way" osm_id="90394480" place_rank="30" ...OMISSIS... importance="0.701">
在上面的回复中,我删除了所有我不感兴趣的XML部分.
我已经使用了上面文档中的示例,但它看起来并不像它那样工作.
如果我打电话
set_user_agent('MyClient');
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Cannot delegate set_user_agent to header because the value of request is not defined at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Moose/Exception.pm line 37
Moose::Exception::_build_trace('Moose::Exception::AttributeValueIsNotDefined=HASH(0x7f5f108)') called at reader Moose::Exception::trace (defined at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Moose/Exception.pm line 9) line 7
Moose::Exception::trace('Moose::Exception::AttributeValueIsNotDefined=HASH(0x7f5f108)') called at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Moose/Exception.pm line 49
Moose::Exception::BUILD('Moose::Exception::AttributeValueIsNotDefined=HASH(0x7f5f108)', 'HASH(0x7f945a8)') called at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Class/MOP/Method.pm line 128
Class::MOP::Method::execute('Moose::Meta::Method=HASH(0x8ed3200)', 'Moose::Exception::AttributeValueIsNotDefined=HASH(0x7f5f108)', 'HASH(0x7f945a8)') called at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Moose/Object.pm line 56
Moose::Object::BUILDALL('Moose::Exception::AttributeValueIsNotDefined=HASH(0x7f5f108)', 'HASH(0x7f945a8)') called at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Moose/Meta/Class.pm line 290
Moose::Meta::Class::new_object('Moose::Meta::Class=HASH(0x8e192e8)', 'HASH(0x7f945a8)') called at /opt/xt/xt-perl/lib/site_perl/5.18/x86_64-linux/Moose/Object.pm line 27
Moose::Object::new('Moose::Exception::AttributeValueIsNotDefined', 'method', 'Moose::Meta::Method::Delegation=HASH(0x887cd78)', 'instance', 'Spider=HASH(0x7f4c910)', 'attribute', 'Moose::Meta::Attribute=HASH(0x8cbc7f8)') …Run Code Online (Sandbox Code Playgroud)