Ignore:
Timestamp:
2011-10-07T11:36:07+13:00 (13 years ago)
Author:
sjm84
Message:

Lucene 3.x version of code accidentally commited rolling back to 2.x compatible version

File:
1 edited

Legend:

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

    r24725 r24731  
    3333
    3434import java.io.IOException;
    35 import java.io.File;
    3635import java.util.Arrays;
    3736import java.util.Enumeration;
     
    3938
    4039import org.apache.lucene.analysis.Analyzer;
    41 //import org.apache.lucene.analysis.standard.StandardAnalyzer;
     40import org.apache.lucene.analysis.standard.StandardAnalyzer;
    4241import org.apache.lucene.document.Document;
    4342import org.apache.lucene.document.Field;
    44 
    45 import org.apache.lucene.store.SimpleFSDirectory;
    46 import org.apache.lucene.index.IndexWriter.MaxFieldLength;
    4743
    4844
     
    150146        throws IOException
    151147    {
    152         Analyzer analyzer = new GS2Analyzer();
     148        Analyzer analyzer = new StandardAnalyzer();
    153149        // create an index in /tmp/index, overwriting an existing one:
    154150        index_modifier = new GS2IndexModifier(index_path, analyzer);
     
    192188    {
    193189        debug("GS2LuceneEditor.editIndex(" + node_id + ",'" + field + "','" + old_value + "','" + new_value + "')");
    194         debug("- Initial number of documents in index: " + index_modifier.numDocs());
     190        debug("- Initial number of documents in index: " + index_modifier.docCount());
    195191        // Retrieve the document requested
    196192        int doc_num = index_modifier.getDocNumByNodeID(node_id);
     
    234230                // We also have to initialize the nodeId value
    235231        // changed to use docOID --kjdon
    236                 document.add(new Field("docOID", String.valueOf(node_id), Field.Store.YES, Field.Index.ANALYZED));
     232                document.add(new Field("docOID", String.valueOf(node_id), Field.Store.YES, Field.Index.TOKENIZED));
    237233
    238234                // Re-index document
     
    300296                for(int i = 0; i < values.size(); i++)
    301297                    {
    302                         document.add(new Field(field, (String)values.get(i), Field.Store.YES, Field.Index.ANALYZED));
     298                        document.add(new Field(field, (String)values.get(i), Field.Store.YES, Field.Index.TOKENIZED));
    303299                    }
    304300                values.clear();
     
    322318                for(int i = 0; i < values.size(); i++)
    323319                    {
    324                         document.add(new Field(field, (String)values.get(i), Field.Store.YES, Field.Index.ANALYZED));
     320                        document.add(new Field(field, (String)values.get(i), Field.Store.YES, Field.Index.TOKENIZED));
    325321                    }
    326322                values.clear();
Note: See TracChangeset for help on using the changeset viewer.