Ensure that the item is in the archive and eligible for indexing before adding it to Lucene

git-svn-id: http://scm.dspace.org/svn/repo/trunk@2197 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Graham Triggs
2007-09-17 15:38:10 +00:00
parent 800a77bfe1
commit 6a90077cb1

View File

@@ -243,18 +243,23 @@ public class DSIndexer
switch (dso.getType())
{
case Constants.ITEM :
if(requiresIndexing(handle, ((Item)dso).getLastModified()) || force)
Item item = (Item)dso;
if (item.isArchived() && !item.isWithdrawn())
{
Document doc = buildDocument(context, (Item) dso);
/* open inside stale block, after building doc
* to limit the total time spent in a lock.
*/
writer = openIndex(context, false);
writer.updateDocument(t, doc);
log.info("Wrote Item: " + handle + " to Index");
if(requiresIndexing(handle, ((Item)dso).getLastModified()) || force)
{
Document doc = buildDocument(context, (Item) dso);
/* open inside stale block, after building doc
* to limit the total time spent in a lock.
*/
writer = openIndex(context, false);
writer.updateDocument(t, doc);
log.info("Wrote Item: " + handle + " to Index");
}
}
break;
case Constants.COLLECTION :