lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Smith <ssm...@mainstreamdata.com>
Subject RE: Highlighting phrases
Date Wed, 27 Nov 2013 16:59:55 GMT
Never mind.  I figured it out.  Thanks anyway.

-----Original Message-----
From: Scott Smith [mailto:ssmith@mainstreamdata.com] 
Sent: Wednesday, November 27, 2013 9:27 AM
To: java-user@lucene.apache.org
Subject: Highlighting phrases

I'm doing some highlighting with the following code fragment:

            formatter = new SimpleHTMLFormatter(<b>,
                    </b>);
            Scorer score = new QueryScorer(myQuery);
            ht = new Highlighter(formatter, score);
            ht.setTextFragmenter(new NullFragmenter());
            markedString = ht.getBestFragment(ctf, myText);


However, if myQuery has a phrase like "john smith", then it will highlight "john" every place
it sees it and "smith" everyplace it sees it regardless of whether they are together.  Is
this expected behavior?  Is there any way to get phrases to be properly highlighted?


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message