lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spencer, Dave" <>
Subject RE: How to get all field names
Date Tue, 12 Nov 2002 18:01:49 GMT
This fragment (from a JSP page..) should dump the
fields for an index in alphabetical order - this
is not precisely what you're asking however -this is all
the fields used in an *index*, not a document, but
anyway maybe this helps:

IndexReader r = indexName);
TermEnum te = r.terms();
Set s = new TreeSet();
while (
	Term t = te.term();
	s.add( t.field());

o.println( "These are all the fields in the index and they can be
searched on...<p>");
Iterator it = s.iterator();
while ( it.hasNext())
	o.println( + "<br>");

-----Original Message-----
From: Christoph Kiehl []
Sent: Tuesday, November 12, 2002 1:11 AM
Subject: How to get all field names


I was wondering if there is a possibility to get a list of all field
that have ever been used to index a document? This way I could filter
some special fields, like identity and such, and do a search over the
remaining. That would give me total freedom to choose any document
and have all fields searched. Is this possible? Or do anyone of you have
better way achieving that?


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message