Ignore:
Timestamp:
2011-10-05T15:44:19+13:00 (13 years ago)
Author:
davidb
Message:

Restruturing of Lucene version 2.x and 3.x to make it easier to control which one is used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/lucene-gs/src/org/greenstone/LuceneWrapper/GS2LuceneDelete.java

    r16583 r24725  
    3333
    3434import java.io.IOException;
    35 import org.apache.lucene.analysis.standard.StandardAnalyzer;
     35import java.io.File;
     36//import org.apache.lucene.analysis.standard.StandardAnalyzer;
    3637import org.apache.lucene.index.IndexWriter;
    3738import org.apache.lucene.index.Term;
     39
     40import org.apache.lucene.store.SimpleFSDirectory;
     41import org.apache.lucene.index.IndexWriter.MaxFieldLength;
    3842
    3943
     
    128132        throws IOException
    129133    {
    130     index_writer = new IndexWriter(index_path, new StandardAnalyzer());
     134    SimpleFSDirectory index_path_dir = new SimpleFSDirectory(new File(index_path));
     135    index_writer = new IndexWriter(index_path_dir, new GS2Analyzer(),
     136                       MaxFieldLength.UNLIMITED);
    131137    }
    132138
     
    163169    {
    164170        debug("GS2LuceneDelete.deleteDocument(" + node_id + ")");
    165         debug("- Initial number of documents in index: " + index_writer.docCount());
     171        debug("- Initial number of documents in index: " + index_writer.numDocs());
    166172    index_writer.deleteDocuments(new Term("nodeid", "" + node_id));
    167         debug("- Final number of documents in index: " + index_writer.docCount());
     173        debug("- Final number of documents in index: " + index_writer.numDocs());
    168174    }
    169175}
Note: See TracChangeset for help on using the changeset viewer.