【问题标题】:Solr Distributed Search returns Empty document listSolr 分布式搜索返回空文档列表
【发布时间】:2015-05-06 00:13:05
【问题描述】:

我通过配置多个集合(每天 1 个)以云模式运行 Solr (4.10)。结构如下图。如果我查询单个集合,我可以获取给定查询的文档。但是,当我将分布式请求发送到多个分片时,我只看到 numFound 并且没有返回任何文档。感谢有关设置的任何指示。

我还尝试创建涵盖多个集合的别名。但结果还是一样。

--- directory structure:
    solr
        collection1                   //(does not have any index)
        collection_20150112
        collection_20150113

运行 Solr 的命令: sh bin/solr restart -d example -cloud -p 9999 -noprompt

Set up RequestHandler called alias in solrconfig.xml of collecton1

  <requestHandler name="/alias" class="solr.StandardRequestHandler" default="true">
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <str name="wt">json</str>
       <str name="indent">true</str>
       <str name="df">text</str>
       <str name="fl">score,*</str>
       <str name="shards">http://localhost:9999/solr/collection_20150113,http://localhost:9999/solr/collection_20150112</str>
     </lst>

http://localhost:9999/solr/collection1/alias?q=domain:com&debug=false&shard.info=true&fl=*
e.g
{
responseHeader: 
{
status: 0,
QTime: 19,
params: 
{
q: "domain:com",
debug: "false",
shard.info: "true"
}
},
response: 
{
numFound: 11696,
start: 0,
maxScore: 1.3015664,
docs: [ ]
}
}

但是,如果要求 fl=id,则返回 id http://localhost:9999/solr/collection1/alias?q=domain:com&debug=false&shard.info=true&fl=id

{
responseHeader: {
status: 0,
QTime: 9,
params: {
fl: "id",
q: "domain:com",
wt: "json",
rows: "2"
}
},
response: {
numFound: 1386,
start: 0,
maxScore: 2.164481,
docs: [
{
id: "1c3781d3-bb28-4060-9150-09b0cc9d0084"
},
{
id: "d3e45451-0b75-4eb2-9740-3a139c182359"
}
]
}
}

【问题讨论】:

    标签: solr solrcloud


    【解决方案1】:

    好的,所以我遇到了同样的问题。此处提供了解决方案:http://lucene.472066.n3.nabble.com/Solr-4-3-1-query-does-not-return-documents-just-numFounds-2-shards-replication-Factor-1-td4081073.html

    基本上,我的唯一 ID 使用了不区分大小写的字符串类型,这会导致查找字段时出现问题。将 UID 字段更改为“字符串”更正了获取字段的查找并修复了空文档列表。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多