org.eaglei.solr
Class AbstractLuceneIndexerNew

java.lang.Object
  extended by org.eaglei.solr.AbstractLuceneIndexerNew
All Implemented Interfaces:
org.eaglei.search.harvest.ResourceChangeListener
Direct Known Subclasses:
LuceneDataSuggestIndexer

public abstract class AbstractLuceneIndexerNew
extends java.lang.Object
implements org.eaglei.search.harvest.ResourceChangeListener


Field Summary
protected  org.apache.lucene.analysis.Analyzer analyzer
           
protected  org.apache.lucene.store.Directory directory
           
protected  org.eaglei.model.EIOntModel eiOntModel
           
protected  java.lang.String indexerLabel
           
 
Constructor Summary
AbstractLuceneIndexerNew(java.lang.String indexerLabel, org.eaglei.model.EIOntModel eiOntModel, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.store.Directory directory)
           
 
Method Summary
protected  boolean commitDocumentCache(org.eaglei.model.EIEntity institution)
          Commits the current in-memory Document cache to the index.
protected  void deleteDocument(java.lang.String keyField, java.lang.String key)
           
protected  org.apache.lucene.document.Document getDocument(java.lang.String keyField, java.lang.String key)
          Gets the Document associated with this key.
protected  org.apache.lucene.document.Document getDocumentFromIndex(java.lang.String keyField, java.lang.String key)
           
protected  org.apache.lucene.index.IndexWriter getWriter()
           
protected  boolean isFlattenClass(org.eaglei.model.EIURI uri)
           
 void onChangeEvent(org.eaglei.search.harvest.ResourceChangeEvent event)
           
 boolean onChangeStreamEnd(org.eaglei.model.EIEntity institution, java.util.Date lastModifiedDate)
           
 void onChangeStreamStart(org.eaglei.model.EIEntity institution)
           
 void optimize()
           
protected  void setDocument(java.lang.String keyField, java.lang.String key, org.apache.lucene.document.Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexerLabel

protected java.lang.String indexerLabel

eiOntModel

protected org.eaglei.model.EIOntModel eiOntModel

analyzer

protected org.apache.lucene.analysis.Analyzer analyzer

directory

protected org.apache.lucene.store.Directory directory
Constructor Detail

AbstractLuceneIndexerNew

public AbstractLuceneIndexerNew(java.lang.String indexerLabel,
                                org.eaglei.model.EIOntModel eiOntModel,
                                org.apache.lucene.analysis.Analyzer analyzer,
                                org.apache.lucene.store.Directory directory)
Method Detail

isFlattenClass

protected boolean isFlattenClass(org.eaglei.model.EIURI uri)

getWriter

protected org.apache.lucene.index.IndexWriter getWriter()
                                                 throws org.apache.lucene.index.CorruptIndexException,
                                                        org.apache.lucene.store.LockObtainFailedException,
                                                        java.io.IOException
Throws:
org.apache.lucene.index.CorruptIndexException
org.apache.lucene.store.LockObtainFailedException
java.io.IOException

onChangeStreamStart

public void onChangeStreamStart(org.eaglei.model.EIEntity institution)
Specified by:
onChangeStreamStart in interface org.eaglei.search.harvest.ResourceChangeListener

onChangeEvent

public void onChangeEvent(org.eaglei.search.harvest.ResourceChangeEvent event)
Specified by:
onChangeEvent in interface org.eaglei.search.harvest.ResourceChangeListener

onChangeStreamEnd

public boolean onChangeStreamEnd(org.eaglei.model.EIEntity institution,
                                 java.util.Date lastModifiedDate)
Specified by:
onChangeStreamEnd in interface org.eaglei.search.harvest.ResourceChangeListener

commitDocumentCache

protected boolean commitDocumentCache(org.eaglei.model.EIEntity institution)
Commits the current in-memory Document cache to the index.


getDocument

protected org.apache.lucene.document.Document getDocument(java.lang.String keyField,
                                                          java.lang.String key)
Gets the Document associated with this key. If the document associated with this key has been previously created, it is guaranteed to be in cache.

Parameters:
key -
Returns:

setDocument

protected void setDocument(java.lang.String keyField,
                           java.lang.String key,
                           org.apache.lucene.document.Document doc)

getDocumentFromIndex

protected org.apache.lucene.document.Document getDocumentFromIndex(java.lang.String keyField,
                                                                   java.lang.String key)

deleteDocument

protected void deleteDocument(java.lang.String keyField,
                              java.lang.String key)

optimize

public void optimize()
Specified by:
optimize in interface org.eaglei.search.harvest.ResourceChangeListener


Copyright © 2009-2011 Eagle-I. All Rights Reserved.