private static IndexWriter openIndex(boolean wipeExisting)
throws IOException
{
Directory dir = FSDirectory.open(new File(indexDirectory));
LimitTokenCountAnalyzer decoratorAnalyzer = null;
/* Set maximum number of terms to index if present in dspace.cfg */
if (maxfieldlength == -1)
{
decoratorAnalyzer = new LimitTokenCountAnalyzer(getAnalyzer(), Integer.MAX_VALUE);
}
else
{
decoratorAnalyzer = new LimitTokenCountAnalyzer(getAnalyzer(), maxfieldlength);
}
IndexWriterConfig iwc = new IndexWriterConfig(luceneVersion, decoratorAnalyzer);
if(wipeExisting){