首页 文章

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

提问于
浏览
0

我通过配置多个集合(每天1个)在 Cloud 模式下运行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 回答

相关问题