org.apache.solr.update
Class SolrIndexWriter
java.lang.Object
org.apache.lucene.index.IndexWriter
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 472574 2006-11-08 18:25:52Z yonik $
- Author:
- yonik
Method Summary |
void |
close()
use DocumentBuilder now... |
Methods inherited from class org.apache.lucene.index.IndexWriter |
addDocument, addDocument, addIndexes, addIndexes, addIndexesNoOptimize, docCount, finalize, getAnalyzer, getCommitLockTimeout, getDefaultCommitLockTimeout, getDefaultWriteLockTimeout, getDirectory, getInfoStream, getMaxBufferedDocs, getMaxFieldLength, getMaxMergeDocs, getMergeFactor, getSimilarity, getTermIndexInterval, getUseCompoundFile, getWriteLockTimeout, optimize, setCommitLockTimeout, setDefaultCommitLockTimeout, setDefaultWriteLockTimeout, setInfoStream, setMaxBufferedDocs, setMaxFieldLength, setMaxMergeDocs, setMergeFactor, setSimilarity, setTermIndexInterval, setUseCompoundFile, setWriteLockTimeout |
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
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
Copyright © 2006 - 2006 The Apache Software Foundation