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: IndexReader getFieldNames()
Date Wed, 19 Mar 2008 13:20:10 GMT
Can you give an example of the output?
What does out.print() do? Does it print spaces between records on new-lines?

On Wed, Mar 19, 2008 at 3:17 PM, varun sood <vsood2@gmail.com> wrote:

> Hi All,
>  Can someone please guide me on how to use IndexReader's
> getFieldNames() method properly?
> I want to get all the filed names in the index. Currently I am getitng
> it via Document object but that not wt i want.
> I am implementing the code below and what I get is a very long string
> of characters.. perhaps equivalent to the number of records in the
> index.
>
> Collection c = ir.getFieldNames(IndexReader.FieldOption.ALL);
> int i = 0;
> while (c.iterator().hasNext()) {
>    Field s = (Field) c.iterator().next();
>    out.print(s.name());
>    i++;
> }
>
> Thanks,
> Varun.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Regards,

Shai Erera

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