org.apache.cocoon.components.search.components
Interface Indexer

All Known Implementing Classes:
AbstractIndexer, DefaultIndexerImpl, ParallelIndexerImpl

public interface Indexer


Field Summary
static java.lang.String DOCUMENT_UID_FIELD
          All lucene documents must have a unique identifier field
static java.lang.String ROLE
           
 
Method Summary
 void clearIndex()
          clear the index
 int del(java.lang.String uid)
          Delete document
 org.apache.lucene.analysis.Analyzer getAnalyzer()
          Get the lucene analyzer
 org.apache.lucene.store.Directory getIndex()
           
 int getMergeFactor()
           
 void index(org.apache.lucene.document.Document doc)
          Index document (update or add if clearIndex() is called before)
 void optimize()
          Optimize the index
 void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
          Set a lucene analyzer
 void setIndex(org.apache.lucene.store.Directory directory)
          Set the index directory
 void setMergeFactor(int value)
          Set a merge factor value + set minMergeDocs=2*mergeFactor (see lucene docs)
 

Field Detail

ROLE

static final java.lang.String ROLE

DOCUMENT_UID_FIELD

static final java.lang.String DOCUMENT_UID_FIELD
All lucene documents must have a unique identifier field

See Also:
Constant Field Values
Method Detail

index

void index(org.apache.lucene.document.Document doc)
           throws IndexException
Index document (update or add if clearIndex() is called before)

Parameters:
doc - Document
Throws:
IndexException

del

int del(java.lang.String uid)
        throws IndexException
Delete document

Parameters:
uid - the uid of the document
Returns:
int the number of deleted documents
Throws:
IndexException

optimize

void optimize()
              throws IndexException
Optimize the index

Throws:
IndexException

setAnalyzer

void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
Set a lucene analyzer

Parameters:
analyzer - the analazer

getAnalyzer

org.apache.lucene.analysis.Analyzer getAnalyzer()
Get the lucene analyzer


setMergeFactor

void setMergeFactor(int value)
Set a merge factor value + set minMergeDocs=2*mergeFactor (see lucene docs)

Parameters:
value - the new merge factor

getMergeFactor

int getMergeFactor()
Returns:
the mergeFactor

clearIndex

void clearIndex()
                throws IndexException
clear the index

Throws:
IndexException

setIndex

void setIndex(org.apache.lucene.store.Directory directory)
              throws IndexException
Set the index directory

Parameters:
directory - the index directory
Throws:
IndexException

getIndex

org.apache.lucene.store.Directory getIndex()
                                           throws IndexException
Throws:
IndexException


Copyright $ Apache Software Foundation. All Rights Reserved.