From java-user-return-44934-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Tue Feb 09 12:44:42 2010 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 68260 invoked from network); 9 Feb 2010 12:44:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 12:44:42 -0000 Received: (qmail 34534 invoked by uid 500); 9 Feb 2010 12:44:40 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 34448 invoked by uid 500); 9 Feb 2010 12:44:40 -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 34438 invoked by uid 99); 9 Feb 2010 12:44:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 12:44:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [140.203.201.100] (HELO mx1.nuigalway.ie) (140.203.201.100) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 12:44:30 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAJvncEsKhJ0L/2dsb2JhbACDMsVYkBSBL4JKWwQ X-IronPort-AV: E=Sophos;i="4.49,436,1262563200"; d="scan'208";a="132421370" Received: from unknown (HELO EVS1.ac.nuigalway.ie) ([10.132.157.11]) by mx1.nuigalway.ie with ESMTP; 09 Feb 2010 12:44:08 +0000 Received: from EVS1.ac.nuigalway.ie ([10.132.157.14]) by EVS1.ac.nuigalway.ie with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Feb 2010 12:44:08 +0000 Received: from [10.2.18.102] ([140.203.154.11]) by EVS1.ac.nuigalway.ie over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Feb 2010 12:44:08 +0000 Message-ID: <4B71588D.3060001@deri.org> Date: Tue, 09 Feb 2010 12:43:57 +0000 From: Renaud Delbru User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100205 Lightning/1.0pre Shredder/3.0.2pre MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Flex & Docs/AndPositionsEnum References: <4B714F5C.2040709@deri.org> <002701caa981$b5400ef0$1fc02cd0$@de> In-Reply-To: <002701caa981$b5400ef0$1fc02cd0$@de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Feb 2010 12:44:08.0101 (UTC) FILETIME=[92234550:01CAA985] X-Virus-Checked: Checked by ClamAV on apache.org Hi Uwe, On 09/02/10 12:16, Uwe Schindler wrote: > 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. > Ok, I have changed my codes to use the AttributeSource interface. > 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. > But, I have still the same problem, it seems that MultiDocsAndPositionsEnum does not have access to the underlying attributes added to my DocsAndPositionsEnum subclass. I got the following exception (IllegalArgumentException): "This AttributeSource does not have the attribute 'org.sindice.siren.analysis.attributes.TupleAttribute'." Is this related to your previous comment, i.e., that MultiReaders do not have a view on the underlying Enums ? > 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. > Ok, it works like a charm except the problem related to MultiReaders. Thanks -- Renaud Delbru --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org