org.apache.solr.update
Class SolrIndexWriter

java.lang.Object
  extended by org.apache.lucene.index.IndexWriter
      extended by org.apache.solr.update.SolrIndexWriter

public class SolrIndexWriter
extends IndexWriter

An IndexWriter that is configured via Solr config mechanisms.

Since:
solr 0.9
Version:
$Id: SolrIndexWriter.java 533507 2007-04-29 14:05:21Z yonik $
Author:
yonik

Field Summary
 
Fields inherited from class org.apache.lucene.index.IndexWriter
DEFAULT_MAX_BUFFERED_DELETE_TERMS, DEFAULT_MAX_BUFFERED_DOCS, DEFAULT_MAX_FIELD_LENGTH, DEFAULT_MAX_MERGE_DOCS, DEFAULT_MERGE_FACTOR, DEFAULT_RAM_BUFFER_SIZE_MB, DEFAULT_TERM_INDEX_INTERVAL, DISABLE_AUTO_FLUSH, MAX_TERM_LENGTH, WRITE_LOCK_NAME, WRITE_LOCK_TIMEOUT
 
Constructor Summary
SolrIndexWriter(String name, String path, boolean create, IndexSchema schema)
           
SolrIndexWriter(String name, String path, boolean create, IndexSchema schema, SolrIndexConfig config)
           
 
Method Summary
 void close()
          use DocumentBuilder now...
protected  void finalize()
           
 
Methods inherited from class org.apache.lucene.index.IndexWriter
abort, addDocument, addDocument, addIndexes, addIndexes, addIndexesNoOptimize, close, deleteDocuments, deleteDocuments, docCount, ensureOpen, flush, flush, getAnalyzer, getDefaultInfoStream, getDefaultWriteLockTimeout, getDirectory, getInfoStream, getMaxBufferedDeleteTerms, getMaxBufferedDocs, getMaxFieldLength, getMaxMergeDocs, getMergeFactor, getMergePolicy, getMergeScheduler, getRAMBufferSizeMB, getSimilarity, getTermIndexInterval, getUseCompoundFile, getWriteLockTimeout, maybeMerge, message, numRamDocs, optimize, optimize, optimize, optimize, ramSizeInBytes, segString, setDefaultInfoStream, setDefaultWriteLockTimeout, setInfoStream, setMaxBufferedDeleteTerms, setMaxBufferedDocs, setMaxFieldLength, setMaxMergeDocs, setMergeFactor, setMergePolicy, setMergeScheduler, setRAMBufferSizeMB, setSimilarity, setTermIndexInterval, setUseCompoundFile, setWriteLockTimeout, updateDocument, updateDocument
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SolrIndexWriter

public SolrIndexWriter(String name,
                       String path,
                       boolean create,
                       IndexSchema schema)
                throws IOException
Throws:
IOException

SolrIndexWriter

public SolrIndexWriter(String name,
                       String path,
                       boolean create,
                       IndexSchema schema,
                       SolrIndexConfig config)
                throws IOException
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
use DocumentBuilder now... private final void addField(Document doc, String name, String val) { SchemaField ftype = schema.getField(name); // we don't check for a null val ourselves because a solr.FieldType // might actually want to map it to something. If createField() // returns null, then we don't store the field. Field field = ftype.createField(val, boost); if (field != null) doc.add(field); } public void addRecord(String[] fieldNames, String[] fieldValues) throws IOException { Document doc = new Document(); for (int i=0; i
Overrides:
close in class IndexWriter
Throws:
IOException

finalize

protected void finalize()
Overrides:
finalize in class IndexWriter


Copyright © 2006 - 2009 The Apache Software Foundation