Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-3390

Highlighting issue with multi-word synonyms causes to highlight the wrong terms

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      I am using solr 3.6 and when I have multi-words synonyms the highlighting results have the wrong word highlighted.

      If I have the below entry in the synonyms file:
      dns, domain name system

      If I index something like: "A sample dns entry explaining the details".

      Searching for "name" (without quotes) in the highlight results/snippets I get : "A sample dns <em>entry</em> explaining the details". (The token "entry" overlaps with the token "name" in the analysis.jsp)

      Searching for "system" (without quotes) in the highlight results/snippets I get : "A sample dns entry <em>explaining</em> the details". (The token "explaining" overlaps with the token "system" in the analysis.jsp)

      Here is my schema field Type:
      <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
      <charFilter class="solr.HTMLStripCharFilterFactory"/>
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
      <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
      <filter class="solr.LowerCaseFilterFactory"/>
      <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
      <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
      <filter class="solr.LowerCaseFilterFactory"/>
      <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      </fieldType>

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sarowe Steven Rowe
            rahul290484 Rahul Babulal
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment