Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 54710 invoked from network); 9 Feb 2010 12:17:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 12:17:11 -0000 Received: (qmail 7436 invoked by uid 500); 9 Feb 2010 12:17:09 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 7363 invoked by uid 500); 9 Feb 2010 12:17:09 -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 7352 invoked by uid 99); 9 Feb 2010 12:17:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 12:17:09 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.25.71.29] (HELO mail.troja.net) (85.25.71.29) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 12:16:59 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 1AD6F45FD75 for ; Tue, 9 Feb 2010 13:16:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.troja.net Received: from mail.troja.net ([127.0.0.1]) by localhost (megaira.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a5OoB5z23PZ4 for ; Tue, 9 Feb 2010 13:16:27 +0100 (CET) Received: from VEGA (unknown [134.102.249.75]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTPSA id BA77845FC2F for ; Tue, 9 Feb 2010 13:16:27 +0100 (CET) From: "Uwe Schindler" To: References: <4B714F5C.2040709@deri.org> In-Reply-To: <4B714F5C.2040709@deri.org> Subject: RE: Flex & Docs/AndPositionsEnum Date: Tue, 9 Feb 2010 13:16:28 +0100 Message-ID: <002701caa981$b5400ef0$1fc02cd0$@de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcqpgDJnbm/vAmIHQGOOxSY+8vufNgAAJSCw Content-Language: de Hi Renaud, In flex the correct way to add additional posting data to these classes = would be the usage of custom attributes, registered in the attributes() = AttributeSource. Due to some limitations, there is currently no working support in = MultiReaders to have a "view" on the underlying Enums, but we are = working on that. In general what you do (if it works in future): Define an interface for your extensions based on the Attribute interface = and also provide the implementation class. Then call = YourEnums.attributes().addAttribute(YourInterface.class) in the ctor of = your enum, store a local reference to the attribute and fill this on = iteration. Any consumer of this Enum can check using = TermPositions.attributes().hasAttribute/getAttribute/addAttribute for = the existence of the the same and then read the attributes during = iteration. There is no need to change the Enum class API at all. It works in the same way like the TokenStreams since 2.9/3.0. Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Renaud Delbru [mailto:renaud.delbru@deri.org] > Sent: Tuesday, February 09, 2010 1:05 PM > To: java-user > Cc: Michael McCandless > Subject: Flex & Docs/AndPositionsEnum >=20 > Hi Michael, >=20 > I have updated my lucene-1458, and I discovered there was big > modifications in the StandardCodec interface. > I updated my own codecs to this new interface, but I encounter a > problem. My codecs are creating DocsAndPositionsEnum subclasses that > allow to access more information than simply the doc, freq and = position > (I have other information encoded into the Prox file). > In the code, to be able to manipulate the additional interface that my > classes provide, I was casting the DocsAndPositionsEnum object = returned > by IndexReader#termPositionsEnum() into the correct subclass. While > this > approach was working in the previous flewx branch, this does not work > anymore with the last committed changes. In certain cases, the > IndexReader#termPositionsEnum() does not return the > DocsAndPositionsEnum > created by the StandardPostingsReader, but a = MultiDocsAndPositionsEnum. > However, I am not able either to subclass the = MultiDocsAndPositionsEnum > or to wrap it into a decorator because it is declared as 'private > static > final' in DirectoryReader. >=20 > Are these classes (MultiTermEnum, MultiDocsAndPositionsEnum, etc.) > hidden in a voluntary manner ? Or is there is another way to extends > StandardCodec without having to deal with these classes ? >=20 > Cheers > -- > Renaud Delbru >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org