2017-04-24 56 views
0

solr v6.5: - 我有一个索引在solr核心的2个pdf文件。当我搜索关键字时,它会在文档中找到,但是,突出显示适用于一个文档,而不是其他文档。例如:当我搜索其中一个文件中的“恐慌”时。我突出显示搜索结果。但是当我搜索“epsilon”时,我得到一个结果表明它已经与文档信息等一起找到,但是,这个文档的突出显示不起作用。 下面有被添加最新的/改变在managed_schema.xml:solr pdf搜索高亮问题

. 
    . 
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true"> 
     <analyzer type="index"> 
     <tokenizer class="solr.StandardTokenizerFactory"/> 
     <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> 
     <!-- in this example, we will only use synonyms at query time 
     <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/> 
     --> 
     <filter class="solr.LowerCaseFilterFactory"/> 
     </analyzer> 
     <analyzer type="query"> 
     <tokenizer class="solr.StandardTokenizerFactory"/> 
     <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> 
     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> 
     <filter class="solr.LowerCaseFilterFactory"/> 
     </analyzer> 
    </fieldType> 
. 
. 
    <field name="_text_" type="text_general" multiValued="true" indexed="true" stored="true"/> 
    <field name="content" type="text_general" multiValued="true" indexed="true" stored="true"/> 
    . 
    . 
    <copyField source="content" dest="_text_"/> 

而且,solrconfig.xml中片段如下:

. 
. 
<requestHandler name="/update/extract" 
        startup="lazy" 
        class="solr.extraction.ExtractingRequestHandler" > 
    <lst name="defaults"> 
     <str name="lowernames">true</str> 
     <str name="fmap.meta">ignored_</str> 
     <str name="fmap.content">_text_</str> 
    </lst> 
    </requestHandler> 
. 
. 
+0

请检查如何使用搜索查询在Solr中索引单词“epsilon”,并检查它是否包含任何空格或大写字母。还要检查你使用什么类型的分析仪用于“_ \ _ text \ __”字段(“index”和“query”)?添加这个问题也可以找到问题。 – Riya

+0

@Riya我很确定,我正在搜索的这个词在文档中也是“原样”。此外,还编辑了字段类型细节 – user7913157

+0

再一次,搜索和突出显示适用于一个pdf文档(小尺寸pdf文件)。但是,搜索工作,但不强调其他pdf(相对较大)。如果有帮助。 – user7913157

回答

0

使用的

hl.maxAnalyzedChars = aLargeEnoughValue

查询中的参数和它让我突出显示了搜索词更远处的搜索词。此参数的默认值为51200.

收集:在Solr中索引时的大文档会为SEARCH提供+ ve结果,但是,高亮显示可能为空/无。如果搜索到的文字更靠近文档,会发生这种情况。简单地增加hl.maxAnalyzedChars的价值可以完成这项工作。