2012-11-22 32 views
3

我们从Solr 3.6升级到Solr 4.0。不幸的是,如何通过唯一键从索引中检索文档的行为显然已经发生了变化。Solr 4.0在字符串字段中搜索

在Solr的3.6以下查询检索单个文件:

key:conf/socc/AscottS09 

但使用的Solr 4.0相同的文档集合时(重新索引),则返回一个空的结果列表。似乎Solr 4.0正在处理/分析术语conf/socc/AscottS09,即使它是solr.StrField类型。查询将按预期在Solr的4.0当术语用引号括起来:

key:"conf/socc/AscottS09"     

schema.xml中:

... 
<fieldType name="string" class="solr.StrField" sortMissingLast="true" mitNorms="true"/> 
... 
<field name="key" type="string" indexed="true" stored="true" multiValued="false" required="true"/> 
... 

这是一个错误或发生了对上Solr的是如何处理的任何改变字符串字段?

编辑:我还没有发现任何相关信息的Solr的迁移的相关信息,需要4.0

+0

你是否在admin ui上使用分析器检查该字段? – stephanruhl

+0

根据我的经验,solr4的行为与您的预期相同,因此应该在您的代码/配置中找到原因。 – heinob

+0

管理员中的分析器正确。但是,在启用调试模式下使用admin ui中的查询字段时,它显示该术语得到了分析和标记: key:conf/socc/AscottS09 key: conf/socc/AscottS09 + key:conf + RegexpQuery(text:/ socc /)+(+ text:ascotts09 + text:ascott + text:s + text:09) + key:conf + text:/ socc/+(+ text:ascotts09 + text:ascott + text:s + text:09) problemzebra

回答