public class Indexer extends Object implements Comparable<Indexer>
| Modifier and Type | Class and Description |
|---|---|
static class |
Indexer.Multiple |
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
errorBuffer |
(package private) static MMBaseIndexDefinition |
nodeLoader
An empty index definition that can be used to obtain nodes from the cloud.
|
| Constructor and Description |
|---|
Indexer(String path,
String index,
List<IndexDefinition> queries,
org.apache.lucene.analysis.Analyzer analyzer,
boolean readOnly,
boolean incrementalUpdates,
Lucene.Scheduler scheduler)
Instantiates an Indexer for a specified collection of queries and options.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addError(String string) |
static void |
addField(org.apache.lucene.document.Document document,
org.apache.lucene.document.Field field,
Indexer.Multiple multiple)
Adds a Field to a Document considering also a 'multiple' setting.
|
(package private) void |
clear(boolean copy) |
int |
compareTo(Indexer o) |
(package private) int |
deleteIndex(String number,
Class<? extends IndexDefinition> klass)
Delete the index for the main element node with the given number.
|
void |
fullIndex()
Drop all data in the index and create a new index by running all queries in this set
and indexing the results.
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer() |
LocalizedString |
getDescription() |
protected org.apache.lucene.store.Directory |
getDirectory() |
protected org.apache.lucene.store.Directory |
getDirectoryForFullIndex() |
List<String> |
getErrors() |
Date |
getLastFullIndex() |
long |
getLastFullIndexDuration() |
String |
getName() |
Node |
getNode(Cloud userCloud,
org.apache.lucene.document.Document doc) |
String |
getPath() |
protected int |
index(CloseableIterator<? extends IndexEntry> i,
org.apache.lucene.index.IndexWriter writer,
String indexId)
Runs the queries for the given cursor, and indexes all nodes that are returned.
|
protected void |
index(IndexEntry entry,
org.apache.lucene.document.Document document)
Indexes an entry, and its sub-indexes (recursively).
|
boolean |
isIncrementalUpdating() |
protected Properties |
loadLastFullIndexTimes() |
(package private) int |
newIndex(String number,
Class<? extends IndexDefinition> klass)
Update the index for the main element node with the given number.
|
protected void |
repare(org.apache.lucene.index.CorruptIndexException ci,
boolean copy) |
protected Date |
setLastFullIndex(long startTime) |
protected void |
storeLastFullIndexTimes(Properties lastIndexed) |
String |
toString() |
(package private) int |
update(IndexDefinition indexDefinition,
Set<String> mains) |
(package private) int |
updateIndex(String number,
Class<? extends IndexDefinition> klass)
Update the index for the main element node with the given number.
|
static final MMBaseIndexDefinition nodeLoader
Indexer(String path, String index, List<IndexDefinition> queries, org.apache.lucene.analysis.Analyzer analyzer, boolean readOnly, boolean incrementalUpdates, Lucene.Scheduler scheduler)
index - Name of the indexqueries - a collection of IndexDefinition objects that select the nodes to index, and contain options on the fields to index.public static void addField(org.apache.lucene.document.Document document,
org.apache.lucene.document.Field field,
Indexer.Multiple multiple)
protected void addError(String string)
public boolean isIncrementalUpdating()
protected org.apache.lucene.store.Directory getDirectory()
throws IOException
IOExceptionprotected org.apache.lucene.store.Directory getDirectoryForFullIndex()
throws IOException
IOExceptionpublic String getName()
public String getPath()
public LocalizedString getDescription()
public org.apache.lucene.analysis.Analyzer getAnalyzer()
protected Properties loadLastFullIndexTimes()
protected void storeLastFullIndexTimes(Properties lastIndexed)
public Date getLastFullIndex()
public long getLastFullIndexDuration()
protected Date setLastFullIndex(long startTime)
int deleteIndex(String number, Class<? extends IndexDefinition> klass)
number - the number of the node whose index to deleteklass - The indexes to be deleted can be restricted to a certain class of IndexDefinition's.int update(IndexDefinition indexDefinition, Set<String> mains)
int updateIndex(String number, Class<? extends IndexDefinition> klass)
number - the number of the node whose index to updateint newIndex(String number, Class<? extends IndexDefinition> klass)
number - the number of the node whose index to updatepublic void fullIndex()
protected int index(CloseableIterator<? extends IndexEntry> i, org.apache.lucene.index.IndexWriter writer, String indexId) throws IOException
IOExceptionprotected void index(IndexEntry entry, org.apache.lucene.document.Document document) throws IOException
IOExceptionvoid clear(boolean copy)
protected void repare(org.apache.lucene.index.CorruptIndexException ci,
boolean copy)
public int compareTo(Indexer o)
compareTo in interface Comparable<Indexer>MMBase 1.9-SNAPSHOT - ${javadoctimestamp}