You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Zartmann, Matthias" <m....@mpdv.com> on 2018/09/26 06:32:12 UTC

Solr empty highlight entry on match?

Hi i'm new in solr and have a problem with the highlighter. The highlighter returns not for every match a highlight text, it works in most cases but not in all (see example,the second entry).
Can anybody help me?

Solr Version: 7.4.0

Query:
http://localhost:8983/solr/mpdv/select?hl.fl=mpdv_content_de&hl=on&q=mpdv_content_de:%22Dynamisches%20Anwendungsverhalten%22



Result:

"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}}}}}


Thank's
Matthias

Re: Solr empty highlight entry on match?

Posted by Yasufumi Mizoguchi <ya...@gmail.com>.
Hi,

The documents might be too long to highlight, I think.
See "hl.maxAnalyzedChars" in reference guide.
https://lucene.apache.org/solr/guide/7_4/highlighting.html

Try to increase hl.maxAnalyzedChars value
or to use hl.alternateField, hl.maxAlternateFieldLength to create
snippets even if Solr failed to create snippets.

Thanks,
Yasufumi

2018年9月26日(水) 2:51 Zartmann, Matthias <m....@mpdv.com>:

> Hi i'm new in solr and have a problem with the highlighter. The
> highlighter returns not for every match a highlight text, it works in most
> cases but not in all (see example,the second entry).
> Can anybody help me?
>
> Solr Version: 7.4.0
>
> Query:
>
> http://localhost:8983/solr/mpdv/select?hl.fl=mpdv_content_de&hl=on&q=mpdv_content_de:%22Dynamisches%20Anwendungsverhalten%22
>
>
>
> Result:
>
> "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}}}}}
>
>
> Thank's
> Matthias
>