|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.search.DSIndexer
public class DSIndexer
DSIndexer contains the methods that index Items and their metadata, collections, communities, etc. It is meant to either be invoked from the command line (see dspace/bin/index-all) or via the indexContent() methods within DSpace. As of 1.4.2 this class has new incremental update of index functionality and better detection of locked state thanks to Lucene 2.1 moving write.lock. It will attempt to attain a lock on the index in the event that an update is requested and will wait a maximum of 30 seconds (a worst case scenario) to attain the lock before giving up and logging the failure to log4j and to the DSpace administrator email account. The Administrator can choose to run DSIndexer in a cron that repeats regularly, a failed attempt to index from the UI will be "caught" up on in that cron.
| Constructor Summary | |
|---|---|
DSIndexer()
|
|
| Method Summary | |
|---|---|
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(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 |
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,
String handle)
Unindex a Docment 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DSIndexer()
| Method Detail |
|---|
public static void indexContent(Context context,
DSpaceObject dso)
throws SQLException
context - Users Contextdso - DSpace Object (Item, Collection or Community
SQLException
IOException
public static void indexContent(Context context,
DSpaceObject dso,
boolean force)
throws SQLException
context - Users Contextdso - DSpace Object (Item, Collection or Communityforce - Force update even if not stale.
SQLException
IOException
public static void unIndexContent(Context context,
DSpaceObject dso)
throws SQLException,
IOException
context - dso - DSpace Object, can be Community, Item, or Collection
SQLException
IOException
public static void unIndexContent(Context context,
String handle)
throws SQLException,
IOException
context - handle -
SQLException
IOException
public static void reIndexContent(Context context,
DSpaceObject dso)
throws SQLException,
IOException
context - context objectdso - object to re-index
SQLException
IOException
public static void createIndex(Context c)
throws SQLException,
IOException
c - context to use
SQLException
IOException
public static void optimizeIndex(Context c)
throws SQLException,
IOException
c - Users Context
SQLException
IOException
public static void main(String[] args)
throws SQLException,
IOException
args - the command-line arguments, none used
IOException
SQLExceptionpublic static void updateIndex(Context context)
context -
public static void updateIndex(Context context,
boolean force)
context - force -
public static void cleanIndex(Context context)
throws IOException,
SQLException
context -
IOException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||