lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Flex & Docs/AndPositionsEnum
Date Tue, 09 Feb 2010 16:51:31 GMT
On Tue, Feb 9, 2010 at 11:35 AM, Renaud Delbru <renaud.delbru@deri.org> wrote:

>> This particular patch doesn't change the Codecs API -- it "only"
>> factors out the Multi* APIs from MultiReader.  Likely you won't need
>> to change your codec... but try applying the patch and see :)
>>
>
> Ok, good news ;o).

Flex is still in flux, though :)

>> However: if you consume the flex API directly, on top of multi readers
>> (something you shouldn't do, for performance reasons), you will have
>> to use MultiField's static methods to get the enums.
>
> In my previous example (registering my codec in IndexWriter, and then use
> IndexReader), do I consume the flex API directly on top of the multi-readers
> directly ? If yes, how to avoid that ?

You should (when possible/reasonable) instead use
ReaderUtil.gatherSubReaders, then iterate through those sub readers
asking each for its flex fields.

But if this is only for testing purposes, and Multi*Enum is more
convenient (and, once attrs work correctly), then Multi*Enum is
perfectly fine.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message