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

PostingsSolrHighlighter support for CustomSeparatorBreakIterator (LUCENE-6485)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5
    • Component/s: highlighter
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Lucene 5.3 added a CustomSeparatorBreakIterator (see LUCENE-6485)

      SOLR-10152.patch uploaded which incorporates CustomSeparatorBreakIterator in PostingsSolrHighlighter.

      • added a new request param option to specify which separator char to use. customSeparatorChar.
      • changed PostingsSolrHighlighter.getBreakIterator to check HighlightParams.BS_TYPE first.
      • if type=='CUSTOM', look for the new separator param, in getBreakIterator, validate it's a single char, & skip locale parsing.
      • 'WHOLE' option moved from parseBreakIterator to getBreakIterator, as it doesn't depend on locale.

      Changes made in:

      • HighlightParams.java
      • PostingsSolrHighlighter.java
      • test cases added in TestPostingsSolrHighlighter

        Issue Links

          Activity

          Hide
          dsmiley David Smiley added a comment -

          +1 looks fine. Did you contribute this simply because, after having done the UnifiedHighlighter, doing this was easy since it's almost the same code so might as well, or do you actually use the PostingsHighlighter over the UnifiedHighlighter? If the latter I'd like to hear how the UH isn't meeting your needs. The UnifiedHighlighter is essentially an evolved version of the PostingsHighlighter.

          Show
          dsmiley David Smiley added a comment - +1 looks fine. Did you contribute this simply because, after having done the UnifiedHighlighter, doing this was easy since it's almost the same code so might as well, or do you actually use the PostingsHighlighter over the UnifiedHighlighter? If the latter I'd like to hear how the UH isn't meeting your needs. The UnifiedHighlighter is essentially an evolved version of the PostingsHighlighter.
          Hide
          sarkaramrit2@gmail.com Amrit Sarkar added a comment -

          Mr Smiley,

          The Former. It was really straightforward configuring CustomSeparatorBreakIterator in PostingsSolrHighlighter. I understand UnifiedSolrHighlighter is the most flexible one in terms of configuration compared to other three available( including the default). As PostingsSolrHighlighter is the ancestor, I thought it would be better if this particular configuration is also backported. I will let you and others in the community decide if it is. Thank you for your feedback.

          Show
          sarkaramrit2@gmail.com Amrit Sarkar added a comment - Mr Smiley, The Former. It was really straightforward configuring CustomSeparatorBreakIterator in PostingsSolrHighlighter. I understand UnifiedSolrHighlighter is the most flexible one in terms of configuration compared to other three available( including the default). As PostingsSolrHighlighter is the ancestor, I thought it would be better if this particular configuration is also backported. I will let you and others in the community decide if it is. Thank you for your feedback.
          Hide
          sarkaramrit2@gmail.com Amrit Sarkar added a comment -

          Just a follow up David,

          Are we planning to include this feature in near future? If not, can you let me know what portion needs improvement or the use-case is not that useful.

          Show
          sarkaramrit2@gmail.com Amrit Sarkar added a comment - Just a follow up David, Are we planning to include this feature in near future? If not, can you let me know what portion needs improvement or the use-case is not that useful.
          Hide
          dsmiley David Smiley added a comment -

          Yes. (continue discussion on SOLR-1053 please). I'll commit both issues together.

          Show
          dsmiley David Smiley added a comment - Yes. (continue discussion on SOLR-1053 please). I'll commit both issues together.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit d1d73bfbea3db4adead960fae3597bec7647fba6 in lucene-solr's branch refs/heads/master from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d1d73bf ]

          SOLR-10153: (and SOLR-10152): UH & PH: Add hl.bs.type=SEPARATOR with new param hl.bs.separator

          Show
          jira-bot ASF subversion and git services added a comment - Commit d1d73bfbea3db4adead960fae3597bec7647fba6 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d1d73bf ] SOLR-10153 : (and SOLR-10152 ): UH & PH: Add hl.bs.type=SEPARATOR with new param hl.bs.separator
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a607a2c6cfdeb191b3da4474e87d4242b1270fd1 in lucene-solr's branch refs/heads/branch_6x from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a607a2c ]

          SOLR-10153: (and SOLR-10152): UH & PH: Add hl.bs.type=SEPARATOR with new param hl.bs.separator

          (cherry picked from commit d1d73bf)

          Show
          jira-bot ASF subversion and git services added a comment - Commit a607a2c6cfdeb191b3da4474e87d4242b1270fd1 in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a607a2c ] SOLR-10153 : (and SOLR-10152 ): UH & PH: Add hl.bs.type=SEPARATOR with new param hl.bs.separator (cherry picked from commit d1d73bf)

            People

            • Assignee:
              dsmiley David Smiley
              Reporter:
              sarkaramrit2@gmail.com Amrit Sarkar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development