Hi, I want to modify how the QueryScorer selects fragments for snippeting. I want to add a small boost for fragments that contain certain terms (e.g. "great", "amazing") to the unique term occurrence score. But I don't want these words to actually be highlighted, so I can't just add them to the query (or make a WeightedSpamTerm[] myself containing both the query terms and word list terms and pass it to the QueryScorer).
I tried to subclass lucene.search.highlight.QueryScorer and override the getTokenScore method. But the scorer's PositionIncrementAttribute field is private. I could change the Lucene source or copy QueryScorer's code into a new subclass. I can't find any examples of QueryScorer being subclassed so it seems like there might be a better way to accomplish what I'm trying to do. I'm using Lucene 3.5.0. Thanks, Colin -- View this message in context: http://lucene.472066.n3.nabble.com/Subclassing-QueryScorer-tp4061435.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
