public class DSIndexer
extends java.lang.Object
| Constructor and Description |
|---|
DSIndexer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanIndex(Context context)
Iterates over all documents in the Lucene index and verifies they
are in database, if not, they are removed.
|
static void |
createIndex(Context c)
create full index - wiping old index
|
static void |
indexContent(Context context,
DSpaceObject dso)
If the handle for the "dso" already exists in the index, and
the "dso" has a lastModified timestamp that is newer than
the document in the index then it is updated, otherwise a
new document is added.
|
static void |
indexContent(Context context,
DSpaceObject dso,
boolean force)
If the handle for the "dso" already exists in the index, and
the "dso" has a lastModified timestamp that is newer than
the document in the index then it is updated, otherwise a
new document is added.
|
static void |
main(java.lang.String[] args)
When invoked as a command-line tool, creates, updates, removes
content from the whole index
|
static void |
optimizeIndex(Context c)
Optimize the existing index.
|
static void |
reIndexContent(Context context,
DSpaceObject dso)
reIndexContent removes something from the index, then re-indexes it
|
static void |
setBatchProcessingMode(boolean mode) |
static void |
unIndexContent(Context context,
DSpaceObject dso)
unIndex removes an Item, Collection, or Community only works if the
DSpaceObject has a handle (uses the handle for its unique ID)
|
static void |
unIndexContent(Context context,
java.lang.String handle)
Unindex a Document in the Lucene Index.
|
static void |
updateIndex(Context context)
Iterates over all Items, Collections and Communities.
|
static void |
updateIndex(Context context,
boolean force)
Iterates over all Items, Collections and Communities.
|
public static void setBatchProcessingMode(boolean mode)
public static void indexContent(Context context, DSpaceObject dso) throws java.sql.SQLException, DCInputsReaderException
context - Users Contextdso - DSpace Object (Item, Collection or Communityjava.sql.SQLExceptionjava.io.IOExceptionDCInputsReaderExceptionpublic static void indexContent(Context context, DSpaceObject dso, boolean force) throws java.sql.SQLException, DCInputsReaderException
context - Users Contextdso - DSpace Object (Item, Collection or Communityforce - Force update even if not stale.java.sql.SQLExceptionjava.io.IOExceptionDCInputsReaderExceptionpublic static void unIndexContent(Context context, DSpaceObject dso) throws java.sql.SQLException, java.io.IOException
context - DSpace contextdso - DSpace Object, can be Community, Item, or Collectionjava.sql.SQLExceptionjava.io.IOExceptionpublic static void unIndexContent(Context context, java.lang.String handle) throws java.sql.SQLException, java.io.IOException
context - handle - java.sql.SQLExceptionjava.io.IOExceptionpublic static void reIndexContent(Context context, DSpaceObject dso) throws java.sql.SQLException, java.io.IOException
context - context objectdso - object to re-indexjava.sql.SQLExceptionjava.io.IOExceptionpublic static void createIndex(Context c) throws java.sql.SQLException, java.io.IOException
c - context to usejava.sql.SQLExceptionjava.io.IOExceptionpublic static void optimizeIndex(Context c) throws java.sql.SQLException, java.io.IOException
c - Users Contextjava.sql.SQLExceptionjava.io.IOExceptionpublic static void main(java.lang.String[] args)
throws java.sql.SQLException,
java.io.IOException
args - the command-line arguments, none usedjava.io.IOExceptionjava.sql.SQLExceptionpublic static void updateIndex(Context context)
context - public static void updateIndex(Context context, boolean force)
context - force - public static void cleanIndex(Context context) throws java.io.IOException, java.sql.SQLException
context - java.io.IOExceptionjava.sql.SQLExceptionCopyright © 2013 DuraSpace. All Rights Reserved.