Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-505

FastVectorHighlighter create fragment only with match at the beginning

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • Lucene.Net 2.9.4g
    • None
    • Lucene.Net Contrib
    • None

    Description

      When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder

      Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());

      The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

      Attachments

        1. PatchForSimpleFragListBuilder.patch
          5 kB
          Ricci Gian Maria
        2. FragListBuilder.patch
          4 kB
          Ricci Gian Maria

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alkampfer Ricci Gian Maria
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: