Where did you get 'i'? Keep in mind that using Hits.doc(n) intends
'n' to be a document *id*, not the iteration through the Hits
collection. This is a very common mistake, and I'm guessing one you've
made here.
Erik
On Aug 3, 2004, at 7:49 PM, xuemei li wrote:
Thank you for your reply.
when I want to get the document from hits.It throws
nullpointerexception.But the hits.length() value is not 0.
thanks,
Xuemei Li
What is the exception? Is hits null or the index (i) out of bounds?
sv
On Tue, 3 Aug 2004, xuemei li wrote:
hi,all,
I am using lucene to search.When I use console to run my code it
works
fine.But after I put my code to a servlet.It will throw
exception.Here
is my exception code:
Document doc= hits.doc(i);-->exception
But I can use the following code to get the hits.length() value.
out.println("<center><p>There are "+hits.length()+" matches for
the
word you have entered !</p></center>");
What's the problem?Any reply will be appreciated.
thanks,
Xuemei Li
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]