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 Stadler Hans-Christian <ha...@psi.ch> on 2007/06/05 15:37:47 UTC
Retrieving field names from an index
Hi,
how would I efficently retrieve the names of all possible fields present in an index?
One way would be to iterate over all terms and extract the field names, but it doesn't
look like this method is efficient for large indices.
Murphy for president!
HC
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Retrieving field names from an index
Posted by Mohammad Norouzi <mn...@gmail.com>.
Hi
you can get them from searcher, if documents in your index are the same
Enumeration fields = searcher.doc(0).fields();
On 6/5/07, Stadler Hans-Christian <ha...@psi.ch> wrote:
>
> Hi,
>
> how would I efficently retrieve the names of all possible fields present
> in an index?
>
> One way would be to iterate over all terms and extract the field names,
> but it doesn't
> look like this method is efficient for large indices.
>
> Murphy for president!
> HC
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
--
Regards,
Mohammad
--------------------------
see my blog: http://brainable.blogspot.com/
Re: Retrieving field names from an index
Posted by Erick Erickson <er...@gmail.com>.
Would IndexReader.getFieldNames work?
Erick
On 6/5/07, Stadler Hans-Christian <ha...@psi.ch> wrote:
>
> Hi,
>
> how would I efficently retrieve the names of all possible fields present
> in an index?
>
> One way would be to iterate over all terms and extract the field names,
> but it doesn't
> look like this method is efficient for large indices.
>
> Murphy for president!
> HC
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>