org.openanzo.model.indexer.lucene
Class ModelIndexer

java.lang.Object
  extended by org.openanzo.indexer.lucene.LuceneIndexerBase
      extended by org.openanzo.model.indexer.lucene.ModelIndexer
All Implemented Interfaces:
IIndexer

public class ModelIndexer
extends LuceneIndexerBase

Indexer for Anzo models based on Lucene.

Author:
Wing Yung ( wingyung@us.ibm.com )

Constructor Summary
ModelIndexer()
           
 
Method Summary
static org.apache.lucene.document.Document createDocument(StatementWrapper statementWrapper)
          Create a new IndexDocument for the statement provided
 boolean index(int id, java.lang.Object obj)
          Adds the object to the index.
 int rebuild(java.lang.Object seedObject)
          Rebuilds the index given the seed object.
 void remove(int id, java.lang.Object obj)
          Removes the object from the index.
 
Methods inherited from class org.openanzo.indexer.lucene.LuceneIndexerBase
clear, close, initialize, initialize, postIndex, postRemove, preIndex, preRemove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelIndexer

public ModelIndexer()
Method Detail

index

public boolean index(int id,
                     java.lang.Object obj)
              throws IndexerException
Description copied from interface: IIndexer
Adds the object to the index.

Specified by:
index in interface IIndexer
Specified by:
index in class LuceneIndexerBase
Parameters:
id - id of the indexer, generated by preIndex()
obj - object to add to the index.
Returns:
true if indexing object was successfull
Throws:
IndexerException

remove

public void remove(int id,
                   java.lang.Object obj)
            throws IndexerException
Description copied from interface: IIndexer
Removes the object from the index.

Specified by:
remove in interface IIndexer
Specified by:
remove in class LuceneIndexerBase
Parameters:
id - id of the indexer, generated by preIndex()
obj - object to remove from the index.
Throws:
IndexerException

createDocument

public static org.apache.lucene.document.Document createDocument(StatementWrapper statementWrapper)
Create a new IndexDocument for the statement provided

Parameters:
statementWrapper - index wrapper around an Anzo Statement
Returns:
the indexer's document for this statement

rebuild

public int rebuild(java.lang.Object seedObject)
            throws IndexerException
Description copied from interface: IIndexer
Rebuilds the index given the seed object.

Parameters:
seedObject - object used to rebuild the entire index
Returns:
id of the indexer
Throws:
IndexerException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.