lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: how to get highlighter to only show matched term
Date Thu, 03 Sep 2009 22:54:19 GMT

: text. Basically, I just want to know which of the terms in my query 
: matched and in which field they matched (could be different from my 
: example). I assume that I may need to write my own Formatter for just 
: outputting nothing. But, I'm not sure where to start to get only my 
: needed term. Do I need a custom Fragmenter?

I believe so yes ... i think you might be able to get away with a Fragment 
that always returns "true" from isNewFragment, because i *think* the 
highlighter will do the right thing and merge adjacent fragments that 
both contain matches (in the case of phrase queries) but i'm not 100% 

for questions about implementing Formatters & Fragmenters, you'll probably 
want to ask on java-user@lucene ... there are a lot more people over there 
that udnerstand teh internals of the highlighting code.


View raw message