lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Stone <cityli...@petmystone.com>
Subject Re: Bad file descriptor (IOException) using SearchBean contribution
Date Tue, 18 May 2004 17:43:54 GMT
Erik Hatcher wrote:
> Lucene 1.4 (now in release candidate stage) includes built-in sorting  
> capabilities, so I definitely recommend you have a look at that.   
> SearchBean is effectively deprecated based on this new much more  
> powerful feature.
> 
>     Erik

Forgive my naivety, but isn't the purpose of the SearchBean more than 
just sorting? Without the SearchBean, creating a MVC demo becomes a 
larger exercise to undertake.

Can anyone elaborate further on what Lucene 1.4 RC 3 offers that 
deprecates SearchBean?

Many thanks,
Tim

> 
> On May 18, 2004, at 11:42 AM, Timothy Stone wrote:
> 
>> Lucene Users,
>>
>> I'm using the SearchBean contribution from the sandbox to implement a  
>> Struts application search with Lucene (taking ACO's advice and going  
>> MVC on the demo app.)
>>
>> Right now I'm having a problem with using any Document objects that  
>> might be available and getting an IOException.
>>
>> So basically what I'm doing, and pardon the marshalling code, etc.
>>
>> I have an action that determines the users desired search (internal  
>> via Lucene or external via Google) and forwards appropiately. If the  
>> search is directed to Lucene I create new SearchBean using:
>>
>>     searchBean = new SearchBean(
>>                          FSDirectory.getDirectory(
>>                              getServlet().getInitParameter( "index" ),
>>                              false ),
>>                      query );
>>
>> This bean is put on the request for use in the results.jsp page.
>>
>> I'm able to quite a bit of work with the bean, determine hits, page  
>> counts, etc. except yank a document and display the indexed fields  
>> (I'm using the org.apache.lucene.demo.IndexHTML) such as "title",  
>> "summary", and "url".
>>
>> curr position: <%= searchBean.getHitsIterator().getCurrentPosition() %>
>>
>> <%  if( searchBean.getHitsIterator().hasNext() ) {
>>         Document doc = searchBean.getHitsIterator().next(); // BOOM!
>>     }
>> %>
>>
>> Any ideas? I only see K. Burton's FSDirectory patch in the archives,  
>> but nothing I don't have from CVS.
>>
>> Here's the stack trace:
>>
>> java.io.IOException: Bad file descriptor
>>     at java.io.RandomAccessFile.seek(Native Method)
>>     at  
>> org.apache.lucene.store.FSInputStream.readInternal(FSDirectory.java: 428)
>>     at org.apache.lucene.store.InputStream.refill(InputStream.java:196)
>>     at org.apache.lucene.store.InputStream.readByte(InputStream.java:81)
>>     at org.apache.lucene.store.InputStream.readInt(InputStream.java:111)
>>     at org.apache.lucene.store.InputStream.readLong(InputStream.java:134)
>>     at org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:96)
>>     at  
>> org.apache.lucene.index.SegmentReader.document(SegmentReader.java:275)
>>     at org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:107)
>>     at org.apache.lucene.search.Hits.doc(Hits.java:130)
>>     at org.apache.lucene.beans.HitsIterator.getDoc(HitsIterator.java:161)
>>     at org.apache.lucene.beans.HitsIterator.next(HitsIterator.java:139)
>>     at org.apache.jsp.results_jsp._jspService(results_jsp.java:117)
>>
>> ...
>>
>> Many thanks,
>> Tim
>>
--
/**
  * Timothy Stone  . www.petmystone.com
  * Harrisburg PA  . javafueled at petmystone.com
  * USA            . coffee fueled macintosh zealot
  *
  * "This Satan's drink [coffee] is so
  *  delicious, we shall cheat Satan and
  *  baptize it."
  *  --Pope Clement VIII
  */

---------------------------------------------------------------------
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