Changeset 16438


Ignore:
Timestamp:
2008-07-16T17:27:43+12:00 (13 years ago)
Author:
mdewsnip
Message:

Now uses Lucene 2.3.2's updateDocument() function instead of addDocument(), in preparation for implementing incremental building.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • indexers/trunk/lucene-gs/src/org/greenstone/LuceneWrapper/GS2LuceneIndexer.java

    r16437 r16438  
    4343import org.apache.lucene.document.Field;
    4444import org.apache.lucene.index.IndexWriter;
     45import org.apache.lucene.index.Term;
    4546import org.apache.lucene.analysis.standard.StandardAnalyzer;
    4647
     
    157158    Document current_doc_ = null;
    158159    String current_node_ = "";
     160    String current_doc_oid_ = "";
    159161    String indexable_current_node_ = "";
    160162    String current_contents_ = "";
     
    266268        current_doc_.add(new Field("nodeID", node_id, Field.Store.YES, Field.Index.UN_TOKENIZED));
    267269
    268         String current_doc_oid_ = atts.getValue("gs2:docOID");
     270        current_doc_oid_ = atts.getValue("gs2:docOID");
    269271        current_doc_.add(new Field("docOID", current_doc_oid_, Field.Store.YES, Field.Index.UN_TOKENIZED));
    270272        }
     
    295297        if (qName.equals(doc_tag_level_)) {
    296298        try {
    297             writer_.addDocument(current_doc_);
     299            writer_.updateDocument(new Term("docOID", current_doc_oid_), current_doc_);
    298300        }
    299301        catch (java.io.IOException e) {
Note: See TracChangeset for help on using the changeset viewer.