Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-645

Highligter fails to include non-token at end of string to be highlighted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.9
    • None
    • core/other
    • None
    • Red Hat Linux, Java 1.5
      Windows Java 1.5

    Description

      The following code extract show the problem

      TermQuery query= new TermQuery( new Term( "data", "help" ));
      Highlighter hg = new Highlighter(new SimpleHTMLFormatter(), new QueryScorer( query ));
      hg.setTextFragmenter( new NullFragmenter() );

      String match = null;
      try

      { match = hg.getBestFragment( new StandardAnalyzer(), "data", "help me [54-65]" ); }

      catch (IOException e)

      { e.printStackTrace(); }

      System.out.println( match );

      The sytsem outputs

      <B>help</B> me [54-65

      would expect

      <B>help</B> me [54-65]

      Attachments

        Activity

          People

            Unassigned Unassigned
            adpalmer Andrew Palmer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: