Solr升级到7.2后,日期升压失败

时间:2018-02-15 03:45:53

标签: solr

从4.9.0

升级到solr 7.2.1后,日期提升失败

原创工作4.9.0网址:

http://localhost:8983/solr/facet?fq=-url:http*&fq=-facet_encatname:reference\-documents*&fq=+id:doc*&q{!boost+b=$dateboost+v=$qq}&dateboost=recip(ms(NOW/DAY,soldate),3.16e-11,1,1)&qq=*:*

使用4.9.0中的网址,我得到[numFound] => 647,在7.2.1中我得到[numFound] => 0.由于没有找到文档,因此7.2.1没有得分。

最初,我尝试只对升级进行必要的更改,实际上很少,但仍允许我的TrieDateField。由于查询失败,我尝试将我的日期字段(soldate)更改为DatePointField,然后更改为DateRangeField,但没有成功。更改日志似乎没有提供任何提示。

除了丢弃不再支持的提升之外,我没有对requestHandler进行任何更改。我仍然有defType edismax。

我的debug =查询4.9.0开始:

    [debug] => Array
    (
        [rawquerystring] => {!boost b=$dateboost v=$qq}
        [querystring] => {!boost b=$dateboost v=$qq}
        [parsedquery] => BoostedQuery(boost(*:*,1.0/(3.16E-11*float(ms(const(1518652800000),date(soldate)))+1.0)))
        [parsedquery_toString] => boost(*:*,1.0/(3.16E-11*float(ms(const(1518652800000),date(soldate)))+1.0))
        [QParser] => LuceneQParser
        [boost_str] => recip(ms(NOW/DAY,soldate),3.16e-11,1,1)
        [boost_parsed] => org.apache.lucene.queries.function.valuesource.ReciprocalFloatFunction:1.0/(3.16E-11*float(ms(const(1518652800000),date(soldate)))+1.0)
        [filter_queries] => Array
         ...

使用7.2.1,我得到:

    [debug] => Array
    (
        [rawquerystring] => {!boost b=$dateboost v=$qq}
        [querystring] => {!boost b=$dateboost v=$qq}
        [parsedquery] => +DisjunctionMaxQuery((((summary:boost summary:b summary:dateboost summary:v summary:qq)~4)^10.0 | ((provname:boost provname:b provname:dateboost provname:v provname:qq)~4) | ((lstitle:boost lstitle:b lstitle:dateboost lstitle:v lstitle:qq)~4)^10.0 | ((rtdcontent:boost rtdcontent:b rtdcontent:dateboost rtdcontent:v rtdcontent:qq)~4) | ((city:boost city:b city:dateboost city:v city:qq)~4)^2.0 | ((ltxt:boost ltxt:b ltxt:dateboost ltxt:v ltxt:qq)~4)^3.0 | ((Synonym(contact:bo contact:bos contact:bost contact:bot contact:bust contact:vost) Synonym(contact:f contact:p) Synonym(contact:dYtYbost contact:dYtibost contact:datYbost contact:datibo contact:datibos contact:datibost contact:datibot contact:datibust contact:dativost contact:dotYbost contact:dotibo contact:dotibos contact:dotibost contact:dotibot contact:dotibust contact:dotivost) Synonym(contact:f contact:p) contact:k)~4)^5.0 | ((cname:boost cname:b cname:dateboost cname:v cname:qq)~4) | ((geo_name:boost geo_name:b geo_name:dateboost geo_name:v geo_name:qq)~4)))
        [parsedquery_toString] => +(((summary:boost summary:b summary:dateboost summary:v summary:qq)~4)^10.0 | ((provname:boost provname:b provname:dateboost provname:v provname:qq)~4) | ((lstitle:boost lstitle:b lstitle:dateboost lstitle:v lstitle:qq)~4)^10.0 | ((rtdcontent:boost rtdcontent:b rtdcontent:dateboost rtdcontent:v rtdcontent:qq)~4) | ((city:boost city:b city:dateboost city:v city:qq)~4)^2.0 | ((ltxt:boost ltxt:b ltxt:dateboost ltxt:v ltxt:qq)~4)^3.0 | ((Synonym(contact:bo contact:bos contact:bost contact:bot contact:bust contact:vost) Synonym(contact:f contact:p) Synonym(contact:dYtYbost contact:dYtibost contact:datYbost contact:datibo contact:datibos contact:datibost contact:datibot contact:datibust contact:dativost contact:dotYbost contact:dotibo contact:dotibos contact:dotibost contact:dotibot contact:dotibust contact:dotivost) Synonym(contact:f contact:p) contact:k)~4)^5.0 | ((cname:boost cname:b cname:dateboost cname:v cname:qq)~4) | ((geo_name:boost geo_name:b geo_name:dateboost geo_name:v geo_name:qq)~4))
        [facet-debug] => Array
        ...
        [QParser] => ExtendedDismaxQParser
        ...

显然,solr已经发生了很大的变化,但是从我所读到的内容来看,eDismax支持LuceneQParser所做的一切,语法明智。我尝试添加!lucene,但它仍然会回来[QParser] => ExtendedDismaxQParser

我花了几天时间搜索并查看调试的输出以查看所有测试。虽然我多年来一直在使用Solr,但这次升级让我很冷。

任何建议表示赞赏。

杰夫

0 个答案:

没有答案