lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renaud Delbru <>
Subject Re: Flex & Docs/AndPositionsEnum
Date Tue, 09 Feb 2010 12:43:57 GMT
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 

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.

Renaud Delbru

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message