从2.4升级到5后,Perld性查询中断

从2.4升级到5后,Perld性查询中断,第1张

概述正如标题所示,我正在升级到ES5.我原来的ES查询看起来像: my $response = $elastic->do_request_new( { query => { filtered => { filter => { 正如标题所示,我正在升级到ES5.我原来的ES查询看起来像:

my $response = $elastic->do_request_new(         {            query       => {                filtered    => {                    filter  => {                        or  => [                            { term  => { _type  => { value => "some_val1" } } },{ term  => { _type  => { value => "some_val2" } } },]                    },query   => {                        query_string    => {                            query   => $qstring,rewrite => "scoring_boolean",analyze_wildcard => "true",}                    }                }            },sort    => [ qw(_score) ],size => 50,},);

我的更新看起来像:

my $response = $elastic->do_request_new(    {        query       => {            bool    => {                should  => [                    { term  => { _type  => { value => "some_val1" } } },],must   => {                    query_string    => {                        query   => $qstring,}                }            }        },);

但是,在我的d性数据库中搜索确切的字符串时,我返回零结果:

{  "took" : 3,"timed_out" : false,"_shards" : {    "total" : 5,"successful" : 5,"Failed" : 0  },"hits" : {    "total" : 0,"max_score" : null,"hits" : [ ]  }}

关于可能发生的事情的任何想法?我的猜测是我的查询结构错了.谢谢!

解决方法 更新:以下固定查询:

my $response = $elastic->do_request_new(    {        query   => {                bool    => {                    must   => [                        {                            query_string => {                                query            => $qstring,rewrite          => "scoring_boolean",}                    ],filter => {                        bool => {                            should => [                                { term => { _type => { value => "some_val1" } } },{ term => { _type => { value => "some_val2" } } },);
总结

以上是内存溢出为你收集整理的从2.4升级到5后,Perld性查询中断全部内容,希望文章能够帮你解决从2.4升级到5后,Perld性查询中断所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1233181.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存