lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: Retrieving FieldInfo
Date Tue, 14 May 2013 11:19:51 GMT
If your documents *always* contain the same fields then yes. But in
general, you can do:

addDocument("f:value");
commit();
addDocument("c:value");
commit();

And each AtomicReader will contain different fields. As getFieldInfos()
documents "Get the {@link FieldInfos} describing all fields in *this*reader."

Shai


On Tue, May 14, 2013 at 1:35 PM, Nicola Buso <nbuso@ebi.ac.uk> wrote:

> Hi,
>
> I was looking to a way to obtain FieldInfo(s) from the IndexReader; we
> need in some way to describe the index. Can I do this?
> --------
> AtomicReader ar = <indexReader>.leaves().get(0).reader();
> // than call
> ar.getFieldInfos();
> --------
> What I mean is, can I suppose every AtomicReader in leaves() contain the
> same informations about FieldInfos and I do not need to iterate over
> leaves()?
>
>
> Nicola.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message