您好,我是Solr的新手,但荧光笔有问题。 荧光笔不会为每个匹配项都返回一个突出显示的文本,它在大多数情况下都有效,但在所有情况下都不能(请参见示例第二个条目)。 有人可以帮我吗?
Solr版本:7.4.0
查询:
http://localhost:8983/solr/mpdv/select?hl.fl=mpdv_content_de&hl=on&q=mpdv_content_de:%22Dynamisches%20Anwendungsverhalten%22
结果:
"highlighting":{
"y:\\MPDVAll\\ProductDocumentations\\de\\Procedures\\MDS_MOC\\MDS-Extensibility.pdf":{
"mpdv_content_de":[" <em>Dynamisches</em> <em>Anwendungsverhalten</em> \n\n• Spezifische Logik zur Sichtbarkeit/Aktivierbarkeit"]},
"y:\\MPDVAll\\ProductDocumentations\\de\\FunctionPackages\\MDS-BAS_8.1\\MDS-BAS_81.pdf":{}}}
Debugoutput:
"debug":{
"rawquerystring":"mpdv_content_de:\"Dynamisches Anwendungsverhalten\"",
"querystring":"mpdv_content_de:\"Dynamisches Anwendungsverhalten\"",
"parsedquery":"PhraseQuery(mpdv_content_de:\"dynamisch anwendungsverhalt\")",
"parsedquery_toString":"mpdv_content_de:\"dynamisch anwendungsverhalt\"",
"explain":{
"y:\\MPDVAll\\ProductDocumentations\\de\\Procedures\\MDS_MOC\\MDS-Extensibility.pdf":"\n11.151565 = weight(mpdv_content_de:\"dynamisch anwendungsverhalt\" in 2351) [SchemaSimilarity], result of:\n 11.151565 = score(doc=2351,freq=2.0 = phraseFreq=2.0\n), product of:\n 8.509058 = idf(), sum of:\n 2.1873097 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 343.0 = docFreq\n 3060.0 = docCount\n 6.3217487 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 5.0 = docFreq\n 3060.0 = docCount\n 1.3105522 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:\n 2.0 = phraseFreq=2.0\n 1.2 = parameter k1\n 0.75 = parameter b\n 1436.7814 = avgFieldLength\n 1688.0 = fieldLength\n",
"y:\\MPDVAll\\ProductDocumentations\\de\\FunctionPackages\\MDS-BAS_8.1\\MDS-BAS_81.pdf":"\n1.0496296 = weight(mpdv_content_de:\"dynamisch anwendungsverhalt\" in 1372) [SchemaSimilarity], result of:\n 1.0496296 = score(doc=1372,freq=2.0 = phraseFreq=2.0\n), product of:\n 8.509058 = idf(), sum of:\n 2.1873097 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 343.0 = docFreq\n 3060.0 = docCount\n 6.3217487 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 5.0 = docFreq\n 3060.0 = docCount\n 0.123354375 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:\n 2.0 = phraseFreq=2.0\n 1.2 = parameter k1\n 0.75 = parameter b\n 1436.7814 = avgFieldLength\n 53272.0 = fieldLength\n"},
"QParser":"LuceneQParser",
"timing":{
"time":9.0,
"prepare":{
"time":0.0,
"query":{
"time":0.0},
"facet":{
"time":0.0},
"facet_module":{
"time":0.0},
"mlt":{
"time":0.0},
"highlight":{
"time":0.0},
"stats":{
"time":0.0},
"expand":{
"time":0.0},
"terms":{
"time":0.0},
"debug":{
"time":0.0}},
"process":{
"time":8.0,
"query":{
"time":0.0},
"facet":{
"time":0.0},
"facet_module":{
"time":0.0},
"mlt":{
"time":0.0},
"highlight":{
"time":7.0},
"stats":{
"time":0.0},
"expand":{
"time":0.0},
"terms":{
"time":0.0},
"debug":{
"time":1.0}}}}}
答案 0 :(得分:0)
在查询中使用hl.maxAnalyzedChars
以获得突出显示的文本。
您可以增加maxAnalyzedChars的值。
hl.maxAnalyzedChars
:查找突出显示的字符数限制,之后将不突出显示。由于这是最慢的偏移量,因此对于基于分析的偏移量源来说,这主要只是性能问题。默认值为51200。
有关突出显示的更多信息,请参见下面的链接