IndexWriter.Optimize(); return an exception
-------------------------------------------
Key: LUCENENET-195
URL: https://issues.apache.org/jira/browse/LUCENENET-195
Project: Lucene.Net
Issue Type: Bug
Environment: Framework 1.1 .NET
Reporter: Sérgio Araújo
We are using the Lucene search engine a couple of months, on the first approach
seems a very good and high-performance engine.
We are using the your "Lucene.net.dll"API version 2.0.0.4.
We have an index with 20GB approximately, all hours are added news docs to
index and a time per day the optimization is done at 9 pm.
During a couple of days everything ran fine even a day that optimization
process "writer.Optimize();" return the following exception:
"Source array was not long enough. Check srcIndex and length, and the array´s
lower bounds."
Here you can find some parts of my code:
Document doc; doc = null;
IndexWriter writer; writer = null;
writer = new IndexWriter(strArticleIndexFolder, new StandardAnalyzer(), isNew);
writer.SetMergeFactor(1000);
writer.SetMaxMergeDocs(10000);
foreach (ArticleIndexFull objArticleIndex in lstArticleIndexFull)
{
doc = new Document();
doc.Add(newField(O4kFreeSearchTag.ArticleLuceneId,objArticleIndex.ArticleIndexFullId.ToString(),
Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.YES));
doc.Add(newField(O4kFreeSearchTag.ArticleId,objArticleIndex.ArticleId.ToString(),Field.Store.YES,
Field.Index.TOKENIZED, Field.TermVector.YES));
doc.Add(newField(O4kFreeSearchTag.ProductionDate,FactoryBLL.ArticleIndex.ClearCharStream(AlphaNumeric.ConvertToString(objArticleIndex.ProductionDate.ToString("yyyyMMdd",System.Globalization.CultureInfo.GetCultureInfo("en-US")),String.Empty)),Field.Store.NO,
Field.Index.TOKENIZED, Field.TermVector.YES));
....
writer.AddDocument(doc);
}
if (System.DateTime.Now.Hour == 21)
{
writer.Optimize();
}
writer.Close();
If we migrate to last version available in this case the 2.4.3 my problem will
be fixed?
Has my code any kind of problem?
We will appreciate your help.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.