Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63934F565 for ; Tue, 7 May 2013 22:46:04 +0000 (UTC) Received: (qmail 28521 invoked by uid 500); 7 May 2013 22:46:02 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 28442 invoked by uid 500); 7 May 2013 22:46:02 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Delivered-To: moderator for java-user@lucene.apache.org Received: (qmail 48621 invoked by uid 99); 7 May 2013 22:27:40 -0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: encountered temporary error during SPF processing of domain of pollockcolin@gmail.com) Date: Tue, 7 May 2013 15:26:54 -0700 (PDT) From: Colin Pollock To: java-user@lucene.apache.org Message-ID: <1367965614042-4061435.post@n3.nabble.com> Subject: Subclassing QueryScorer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org