lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anand Stephen" <an...@sonic.net>
Subject Re: IndexWriter.optimize bug in version 1.3-final?
Date Sun, 25 Jan 2004 18:10:43 GMT
There are no non-western characters in the index.
This is the exception I am getting:
> > > java.io.FileNotFoundException:
> > > C:\resin-2.1.4\ML4.1Admin_index.temp\_88.fnm (The system cannot find
> > > the
> > > file specified)
> > > at java.io.RandomAccessFile.open(Native Method)
> > > at java.io.RandomAccessFile. <init >(RandomAccessFile.java:98)
> > > at java.io.RandomAccessFile. <init >(RandomAccessFile.java:143)
> > > at
> > >
> > org.apache.lucene.store.FSInputStream$Descriptor. <init
> >(FSDirectory.java:389)
> > > at org.apache.lucene.store.FSInputStream. <init
>(FSDirectory.java:418)
> > > at org.apache.lucene.store.FSDirectory.openFile(FSDirectory.java:291)
> > > at org.apache.lucene.index.FieldInfos. <init >(FieldInfos.java:80) at
> > > org.apache.lucene.index.SegmentReader. <init >(SegmentReader.java:138)
> > > at
> > >
> > org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:423)
> > > at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:311)

thank you,
--a


----- Original Message ----- 
From: "Jamie Stallwood" <jubilee@project76.co.uk>
To: "Lucene Developers List" <lucene-dev@jakarta.apache.org>
Sent: Sunday, January 25, 2004 2:52 AM
Subject: RE: IndexWriter.optimize bug in version 1.3-final?


> If you are using an index created in 1.3RC1 or lower, and you have certain
> non-western characters in indexed terms, the change in term sorting causes
a
> 'Term out of order' exception. Is this what you are getting?
> If so, you could use an IndexReader to access all the documents in the
> present index, and add them all into a new index.
>
> -----Original Message-----
> From: Anand Stephen [mailto:anand@sonic.net]
> Sent: 25 January 2004 07:35
> To: lucene-user@jakarta.apache.org; lucene-dev@jakarta.apache.org
> Subject: IndexWriter.optimize bug in version 1.3-final?
>
> Anyone else have this problem?
> thank you,
> --a
> ----------------------
>
>
>
> The source code of the method.
> It fails at ( writer.optimize();// This is where it fails), which is not
> within a try/catch.
> It works great with the lucene-1.2 version but fails with the
> lucene-1.3-final.jar
> Any ideas would be appreciated.
> Apologies for posting this question to the dev list initially.
>
> ---- code ----
> public synchronized void index() throws Exception {
> final ProductDocumentBuilder productDocument =
> ProductDocumentBuilder.getInstance();
> productFactory = new ProductFactory(productHome, pgroupHome);
>
> registerDocumentBuilder( "ml.product ", productDocument);
> registerFactory( "ml.product ", productFactory);
>
> logger.info( "index() starting. ");
>
> logger.info( " loaded data, indexing ");
>
> // create the indexer
> IndexWriter writer = new IndexWriter(workDir, new
> StandardAnalyzer(), true);
> writer.mergeFactor = mergeFactor;
> long start = System.currentTimeMillis();
> // pass in a dummy new Object
> Iterator allProducts = productFactory.contentIterate(new Object());
> int i = 0;
> while (allProducts.hasNext()) {
> i++;
> SearchProduct product = (SearchProduct) allProducts.next();
> try {
> writer.addDocument(productDocument.getDocument(product));
> } catch (Exception e) {
> logger.warn( "Failed to index Product: " + product.getPK(),
> e);
> }
> }
>
> writer.optimize();// This is where it fails
> writer.close();
> logger.info( " indexer took " + (System.currentTimeMillis() -
> start) + " milliseconds. To index " + i + " products ");
> productFactory.flush();
> }
> -- end code -------------------
>
> - thank you,
> --a
>
> > This is a question for lucene-user list...redirecting.
> >
> > Looks okay, except it doesn 't look like real code. Also, you are
> > catching Exception and only logging it. Maybe that exception hides the
> > source of the problem.
> >
> > Otis
> >
> > --- anand@(protected) wrote:
> > > Greetings,
> > > I upgraded from lucene-1.2.jar to lucene-1.3-final.jar
> > > (29-Dec-2003).
> > > I get the following error with the new version any ideas?
> > >
> > > <error >
> > > java.io.FileNotFoundException:
> > > C:\resin-2.1.4\ML4.1Admin_index.temp\_88.fnm (The system cannot find
> > > the
> > > file specified)
> > > at java.io.RandomAccessFile.open(Native Method)
> > > at java.io.RandomAccessFile. <init >(RandomAccessFile.java:98)
> > > at java.io.RandomAccessFile. <init >(RandomAccessFile.java:143)
> > > at
> > >
> > org.apache.lucene.store.FSInputStream$Descriptor. <init
> >(FSDirectory.java:389)
> > > at org.apache.lucene.store.FSInputStream. <init
>(FSDirectory.java:418)
> > > at org.apache.lucene.store.FSDirectory.openFile(FSDirectory.java:291)
> > > at org.apache.lucene.index.FieldInfos. <init >(FieldInfos.java:80) at
> > > org.apache.lucene.index.SegmentReader. <init >(SegmentReader.java:138)
> > > at
> > >
> > org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:423)
> > > at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:311)
> > > </error >
> > >
> > > <code >
> > > IndexWriter writer = new IndexWriter( <workDir >, new
> > > StandardAnalyzer(), true);
> > > writer.mergeFactor = <mergeFactor >;
> > > long start = System.currentTimeMillis();
> > > // pass in a dummy new Object
> > > Iterator iter;// returns approriate iterator
> > > while (condition) {
> > > try {
> > >     writer.addDocument( <doc >);
> > > } catch (Exception e) {
> > > logger.error( "Failed to index doc " );
> > > }
> > > }
> > > writer.optimize();
> > > writer.close();
> > >
> > > </code >
> > >
> > > -- anand stephen
> > >
> > >
> > >
> > >
>
>
>
>
> --
> Visit us at http://www.project76.co.uk
> THE SITE for Little Britain!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>


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


Mime
View raw message