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 93C076042 for ; Tue, 24 May 2011 13:33:50 +0000 (UTC) Received: (qmail 65478 invoked by uid 500); 24 May 2011 13:33:48 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 65421 invoked by uid 500); 24 May 2011 13:33:48 -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 Received: (qmail 65413 invoked by uid 99); 24 May 2011 13:33:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 13:33:48 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=SPF_PASS,T_FRT_ADULT2 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of koji@r.email.ne.jp designates 202.224.39.198 as permitted sender) Received: from [202.224.39.198] (HELO mail2.asahi-net.or.jp) (202.224.39.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 May 2011 13:33:41 +0000 Received: from Koji-Sekiguchi-no-MacBook-Pro.local (w244069.ppp.asahi-net.or.jp [121.1.244.69]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id ABB80E597E for ; Tue, 24 May 2011 22:33:19 +0900 (JST) Message-ID: <4DDBB39F.1080302@r.email.ne.jp> Date: Tue, 24 May 2011 22:33:19 +0900 From: Koji Sekiguchi User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ja-JP-mac; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: FastVectorHighlighter - can FieldFragList expose fragInfo? References: <1306175304.11040.33.camel@lysdexic.healthline.com> In-Reply-To: <1306175304.11040.33.camel@lysdexic.healthline.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit (11/05/24 3:28), Sujit Pal wrote: > Hello, > > My version: Lucene 3.1.0 > > I've had to customize the snippet for highlighting based on our > application requirements. Specifically, instead of the snippet being a > set of relevant fragments in the text, I need it to be the first > sentence where a match occurs, with a fixed size from the beginning of > the sentence. > > For this, I built (in my application code, using Lucene jars) a custom > FragmentsBuilder (subclassing SimpleFragmentBuilder and overriding the > createFragment(IndexReader reader, int docId, String fieldName, > FieldFragList fieldFragList). > > However, the FieldFragList does not allow access to the > List member variable. I changed this locally to be > public so my subclass can access it, ie: > > public List fragInfos = new > ArrayList(); > > Once this is done, my createFragment method can get at the fragInfos > from the passed in fieldFragList, iterate through its > WeightedFragInfo.SubInfo.Toffs to get the term offsets, which I then use > to calculate and highlight my snippet (I can provide the code if it > makes things clearer, but thats the gist). > > So my question is - would it be feasible to make the > FieldFragList.fragInfos variable public in a future release? No. Please open a jira ticket and attach a patch, if possible. I'll take a look. koji -- http://www.rondhuit.com/en/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org