I can't tell where you have a bug, but a couple of things look bad here:
1) java + HTML
2) opening/closing of the searcher for each request
3) empty if block in the else block.  who knows, maybe you are hitting that.

I think you simply need to do a little bit more debugging on your end.  Write a 
simple class that calls searcher.search(query string here) and *just* loop 
through all Hits without any if/else tests, and you'll see you'll loop though 
hits.length() matches.

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch


----- Original Message ----
> From: Hasan Diwan <[EMAIL PROTECTED]>
> To: java-user@lucene.apache.org
> Sent: Friday, May 16, 2008 1:32:16 PM
> Subject: Re: All results
> 
> On 15/05/2008, Otis Gospodnetic wrote:
> > What does your code look like?  If you are using Hits, what does 
> > hits.length() 
> give you?
> 
> Me code is below:
> Hits hits = searcher.search(parsedQuery);
>                 if (hits.length() == 0) {
>                     writer.print("Sorry, no results found. >                  
>            + request.getSession().getServletContext()
>                                     .getServletContextName()
>                             + "\">Try again?");
>                     error = true;
>                 } else {
>                     if ((startIndex + maxPage) > hits.length()) {
>                     }
>                     for (int i = startIndex; i != hits.length(); i++) {
>                         final Document document = hits.doc(i);
>                         writer.print("
"
>                                 + document    .get("all")) + "
________________________________
");
>                     } // iterated through every hit
>                     if (searcher != null)
>                         searcher.close();
>                 }
> 
> -- 
> Cheers,
> Hasan Diwan 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to