Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Solr不会检索碎片中部分字符串匹配的结果_Solr - Fatal编程技术网

Solr不会检索碎片中部分字符串匹配的结果

Solr不会检索碎片中部分字符串匹配的结果,solr,Solr,在Solr中,我有3个核心: Unicore 核心1 核心2 Unicore是通用核心,它在core\u 1和core\u 2中有所有字段 我正在获取以下字符串查询的结果“50000912” http://localhost:8983/solr/UniCore/select?q=*text:"50000912"*&wt=json&indent=true&shards=http://localhost:8983/solr/Core_1,http://localhost:

在Solr中,我有3个核心:

  • Unicore

  • 核心1

  • 核心2

    Unicore是通用核心,它在core\u 1和core\u 2中有所有字段

  • 我正在获取以下字符串查询的结果“50000912”

      http://localhost:8983/solr/UniCore/select?q=*text:"50000912"*&wt=json&indent=true&shards=http://localhost:8983/solr/Core_1,http://localhost:8983/solr/Core_2
    
    输出:

    "response":{"numFound":4,"start":0,"maxScore":10.04167,"docs":[
    
    "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]
    
    但是,如果我通过删除字符串末尾的“2”来传递“5000091”而不是“50000912”,我将得到零结果

    输出:

    "response":{"numFound":4,"start":0,"maxScore":10.04167,"docs":[
    
    "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]
    
    使用相同的查询,从技术上来说应该会返回更多的结果,我是否遗漏了一些东西或它是一个bug?谁能纠正我一下吗



    仅供参考,这是我从Core_2获得的数据之一

    "response":{"numFound":4,"start":0,"maxScore":10.04167,"docs":[
      {
        "Storageloc_For_EP":"2500",
        "Material_Number":"50000912-001",
        "Maximum_LotSize":"0",
        "Totrepl_Leadtime":"3",
        "Prodstor_Location":"2000",
        "Country_Of_Origin":"CN",
        "Planned_Deliv_Time":"1",
        "Planning_Time_Fence":"0",
        "Plant":"5515",
        "GR_Processing_Time":"1",
        "Minimum_LotSize":"7920",
        "Rounding_Value":"720",
        "Service_Level_Days":"0",
        "id":"2716447",
        "Fixed_LotSize":"0",
        "Procurement_Type":"F",
        "Automatic_PO":"X",
        "SchedMargin_Key":"005",
        "Service_Level_Qty":"0",
        "MRP_Type":"ZB",
        "Profit_Center":"B2019",
        "_version_":1531317575416283139,
        "[shard]":"http://localhost:8983/solr/Core_2",
        "score":10.04167},
      {
    

    除非您使用了NgramFilter(它将为原始令牌的每个子字符串生成多个令牌),否则Solr不会进行任何子字符串匹配

    我猜您已经将内容索引到一个标准定义的文本字段,这意味着它将在
    -
    上标记。这意味着该文档的索引中存储的
    物料编号
    50000912
    001
    。Solr仅在查询端和索引端标记匹配时才提供命中


    您有几个选项—您可以添加一个标记,该标记将为字符串开头的每个字符组合生成单独的标记,或者由于这是一个数值,您可以使用字符串字段(而不是标记化字段,除非它使用关键字标记器)最后还有一个通配符:
    q=Material\u Number:5000091*
    将为您提供任何以
    5000091
    开头的标记的文档,那么您的实际查询是什么?这些
    *
    是您查询的一部分,还是您试图将查询的相关部分加粗?它们不是查询的一部分,但*不会影响我测试的结果。我认为问题在于上述参考结果中的特殊字符,即Material_Number=“50000912-001”。如果我将搜索字符串传递为“50000912”或“50000912-001”,那么它将给出输出,否则不会输出,对于搜索字符串,如“5000091”或“50000912-00”