lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: GETVALUES +SEARCH
Date Tue, 30 Nov 2004 14:35:52 GMT

On Nov 30, 2004, at 7:10 AM, Karthik N S wrote:
> On Search API the command  [ package  
> org.apache.lucene.document.Document ]
>
> Will this    'public final String[] getValues(String name)'     return 
> me
> all the docs with out looping  thru ?

getValues(fieldName) returns a String[] of the values of the field.  
It's similar to getValue(fieldName).  If you index a field multiple 
times:

	doc.add(Field.Keyword("keyword", "one"));
	doc.add(Field.Keyword("keyword", "two"));

getValue("keyword") will return "one", but getValues("keyword") will 
return a String[] {"one", "two"}

If you want to retrieve all documents, use IndexReader's various API 
methods.

	Erik


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


Mime
View raw message