|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.firstpartners.rp.back.index.BasicIndex
public class BasicIndex
Basic IndexManager to allow adding / searching on a (Lucene based) Index.
Field Summary | |
---|---|
(package private) static java.lang.String |
DEFAULT_DOCUM_AUTHOR
Default document author |
(package private) static java.lang.String |
DEFAULT_DOCUM_PATH
Default document path |
private boolean |
isReady
Flag to mark that index is in re-index process |
protected org.apache.log4j.Logger |
logger
Logger for this class and subclasses |
private java.lang.String |
root
Index root folder ${rp.root}/lucene |
Constructor Summary | |
---|---|
BasicIndex()
|
Method Summary | |
---|---|
private void |
addDocToIndex(org.apache.lucene.document.Document document)
Add the document to the index |
void |
addToIndex(org.apache.lucene.document.Document document)
Reindex the specified document |
java.lang.String |
getRoot()
Get the root index folder |
boolean |
isReady()
Get the ready flag of the index |
void |
onLoad()
Carry out any initiation tasks ( create the index folder and create an empty empty index if already not exists one |
void |
optimize()
Optimize the index (better results time for search process) |
void |
reindex(org.apache.lucene.document.Document[] documentsToUpdate)
Remove the document from the index |
void |
reindex(java.lang.String id,
double score)
Uupdate the calculated score of the document with the specified id Score is already calculated by the category manager = (old_calcscore+weight)*categoryscore |
void |
removeFromIndex(java.lang.String uniqueId)
Remove a piece of information from the index |
void |
setReady(boolean isReady)
Set the ready flag of the inddex |
void |
setRoot(java.lang.String root)
Set the root index folder |
void |
update(DocumStruct[] documentsToUpdate)
Reindex of all the documents with the specified categoryname |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String DEFAULT_DOCUM_PATH
static final java.lang.String DEFAULT_DOCUM_AUTHOR
protected final org.apache.log4j.Logger logger
private java.lang.String root
private boolean isReady
Constructor Detail |
---|
public BasicIndex()
Method Detail |
---|
public void optimize()
optimize
in interface IIndexManager
public void reindex(java.lang.String id, double score)
reindex
in interface IIndexManager
id
- Document idscore
- New score(categoryscore*calc_score) for the documentpublic void addToIndex(org.apache.lucene.document.Document document)
addToIndex
in interface IIndexManager
document
- ID of the document to reindexprivate void addDocToIndex(org.apache.lucene.document.Document document)
document
- public void update(DocumStruct[] documentsToUpdate)
documentsToUpdate
- Name of the category to reindexpublic void reindex(org.apache.lucene.document.Document[] documentsToUpdate)
reindex
in interface IIndexManager
documentsToUpdate
- public void removeFromIndex(java.lang.String uniqueId)
removeFromIndex
in interface IIndexManager
uniqueId
- public void onLoad()
onLoad
in interface IPlugin
public boolean isReady()
public void setReady(boolean isReady)
isReady
- The isReady to set.public java.lang.String getRoot()
getRoot
in interface IIndexManager
public void setRoot(java.lang.String root)
root
- The root to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |