You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by John Patterson <jd...@gmail.com> on 2008/08/13 11:02:56 UTC

Listing fields in an index

Hi,

How do I list all the fields in an index? Some documents do not contain all
fields.

Thanks,

John
-- 
View this message in context: http://www.nabble.com/Listing-fields-in-an-index-tp18959421p18959421.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Listing fields in an index

Posted by Murat Yakici <mu...@cis.strath.ac.uk>.
Use myIndexReader.|*getFieldNames 
<http://www.netlikon.de/docs/javadoc-lucene/lucene_2_3/org/apache/lucene/index/IndexReader.html#getFieldNames%28org.apache.lucene.index.IndexReader.FieldOption%29>*(IndexReader.FieldOption 
<http://www.netlikon.de/docs/javadoc-lucene/lucene_2_3/org/apache/lucene/index/IndexReader.FieldOption.html> fldOption)|;
That should do.
The selection of FieldOption's is important, therefore you need to know 
what you really want to get.

Cheers,

Murat Yakici
Department of Computer & Information Sciences
University of Strathclyde
Glasgow, UK
-------------------------------------------
The University of Strathclyde is a charitable body, registered in Scotland, 
with registration number SC015263.



John Patterson wrote:
> Hi,
>
> How do I list all the fields in an index? Some documents do not contain all
> fields.
>
> Thanks,
>
> John
>   

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


Re: Listing fields in an index

Posted by John Patterson <jd...@gmail.com>.
Thanks!  I was looking in IndexReader for a good couple of minutes and didn't
see that!


Erik Hatcher wrote:
> 
> 
> On Aug 13, 2008, at 5:02 AM, John Patterson wrote:
>> How do I list all the fields in an index? Some documents do not  
>> contain all
>> fields.
> 
> Have a look at IndexReader#getFieldNames().  That'll give you back  
> field names regardless of which documents have them.
> 
> 	Erik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Listing-fields-in-an-index-tp18959421p18961700.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: Listing fields in an index

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Aug 13, 2008, at 5:02 AM, John Patterson wrote:
> How do I list all the fields in an index? Some documents do not  
> contain all
> fields.

Have a look at IndexReader#getFieldNames().  That'll give you back  
field names regardless of which documents have them.

	Erik


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