lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: Problem with indexing/merging indices - documents not indexed.
Date Mon, 06 Dec 2004 23:28:40 GMT
Hi Chris

actually for merging indices that's how Otis did it in the article I quoted:

            // if -r argument was specified, use RAMDirectory
            RAMDirectory ramDir    = new RAMDirectory();
            IndexWriter  ramWriter = new IndexWriter(ramDir, analyzer, 
            addDocs(ramWriter, docsInIndex);
            IndexWriter fsWriter   = new IndexWriter(indexDir, analyzer, 
            fsWriter.addIndexes(new Directory[] { ramDir });

..which works great, and all I've done is replace the addDocs with my 
MySQL version of the function.

I do know about having to close and re-open to find the document count, 
which I've also tried but it didnt yield any difference,
a simple look in the index directory shows no files there except 
segements, even though it should've merged the RAMDir index into the fsDir.



Chris Hostetter said the following on 12/6/2004 6:09 PM:

>: I would appreciate any feedback on my code and whether I'm doing
>: something in a wrong way, because I'm at a total loss right now
>: as to why documents are not being indexed at all.
>I didn't try running your code (because i don't have a DB to test it with)
>but a quick read gives me a good guess as to your problem:
>I believe you to call...
>	ramWriter.close();
>...before you call...
>	fsWriter.addIndexes(new Directory[] { ramDir });
>(I've never played with merging indexes, so i could be completley wrong)
>Everything I've ever read/seen/tried has indicated that untill you "close"
>your IndexWritter, nothing you do will be visible to anybody else who
>opens that "Directory"
>I'm also guessing that when you were trying to add the docs to fsWriter
>directly, you were using an IndexReader you had opened prior to calling
>fsWriter.close() to check the number of docs ... that won't work for hte
>same reason.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message