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



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

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

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

运行 Solr 的命令:sh bin/solr restart -d 示例 -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"
}
]
}
}

好吧,所以我遇到了同样的问题。 解决方案如下: 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 字段更改为"字符串"更正了 get 字段查找并修复了空文档列表。

最新更新