Hi Guys
Apologies...........
Is there any API in Lucene Which can retrieve all the searched Values in
single fetch
into some sort of an 'Array' WITHOUT using this [ below ] Looping
process [ This would make
the Search and display more Faster ].
for (int i = 0; i < hits.length();i++) {
Document doc = hits.doc(i);
String path = doc.get("path");
.....
}
Thx in Advance
Karthik
-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 8:06 PM
To: Lucene Users List
Subject: Re: GETVALUES +SEARCH
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]