2017-09-14 109 views
0

我遇到了solr中集成的拼写检查器的问题。 我有(现在)两个核心,配置相同的solrconfig.xml(具有拼写检查器的正确设置)和稍微不同的XML(具有拼写检查器相同的配置)。Solr spellcheckin随机工作

问题是,对于其中一个核心拼写检查器完美工作,对于其他没有。 对于Solr Admin中没有工作的人,我可以看到字段“拼写”(拼写检查使用的字段)被索引,但没有存储。

有什么想法?

我不认为我将能够发布xml文件,因为它们不属于我。

谢谢大家

编辑:

Solrxml.conf

<requestHandler name="/select" class="solr.SearchHandler"> 
    ... 
    </requestHandler> 

    <searchComponent name="spellcheck" class="solr.SpellCheckComponent"> 
    <lst name="spellchecker"> 
    <str name="classname">solr.IndexBasedSpellChecker</str> 
    <!-- field to use --> 
    <str name="field">spelling</str> 
    <!-- buildOnCommit|buildOnOptimize --> 
    <str name="buildOnCommit">true</str> 
    <!-- $solr.solr.home/data/spellchecker--> 
    <str name="spellcheckIndexDir">./spellchecker</str> 
    <str name="accuracy">0.7</str> 
    <float name="thresholdTokenFrequency">.0001</float> 
    </lst> 
</searchComponent> 

schema.xml中(工作)

<schema name="docs" version="1.5"> 
... 
<field name="fooCore1"  type="text"    indexed="true" stored="true" multiValued="false" /> 

    <!-- Spellcheck --> 
    <field name="spelling"    type="text"    indexed="true" stored="true" multiValued="false" /> 
    <copyField source="fooCore1" dest="spelling" /> 
    ... 

    ... 
    <solrQueryParser defaultOperator="OR"/> 
</schema> 

schema.xml中(不工作)

<schema name="docs" version="1.5"> 
    ... 
     <field name="fooFoo"    type="text"    indexed="true" stored="true" multiValued="false" /> 
     <copyField source="fooFoo"  dest="fooCore" maxChars="300000" /> 
    <!-- Spellcheck --> 
    <field name="fooCore2"    type="text"    indexed="true" stored="true" multiValued="false" /> 
    <copyField source="fooCore2" dest="spelling" maxChars="300000" /> 
    ... 
    </schema> 

第二个模式中的除spelling之外的所有字段都存储并使用它们的值编制索引。

即使尝试创建第三个核心,但它都没有工作。

+0

您是否重建拼写检查索引?如何配置拼写检查器? – MatsLindh

+0

该字典为“IndexBasedSpellChecker”,其中包含对doc提交的更新。拼写检查索引被重建(通过查询Solr Admin)。我甚至尝试过一个新的核心,但它也有同样的问题。两个模式之间唯一的区别是不工作的模式有一个'copyField'属性作为源。 PS:运行Solr 5.4.1 – Ghesio

+0

等待 - 复制域属性作为源?是否有任何东西被插入到该字段中?你能搜索它正在构建的领域吗?这两个字段是如何定义的? – MatsLindh

回答

0

看起来好像copyField不能作为另一个copyField的来源。

将来源从copyfield更改为field错误的模式,它解决了问题。