Solr分布式搜索返回空文档列表

时间:2015-01-15 10:10:11

标签: solr solrcloud

我通过配置多个集合(每天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"
}
]
}
}

1 个答案:

答案 0 :(得分:0)

好的,所以我遇到了同样的问题。此处提供了解决方案: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是使用不区分大小写的字符串类型,这会导致get字段出现问题。将UID字段更改为&#34;字符串&#34;纠正了获取字段的查找并修复了空文档列表。