org.dlese.dpc.index.writer
Class SimpleFileIndexingPlugin
java.lang.Object
org.dlese.dpc.index.writer.SimpleFileIndexingPlugin
- All Implemented Interfaces:
- FileIndexingPlugin
public class SimpleFileIndexingPlugin
- extends Object
- implements FileIndexingPlugin
A FileIndexingPlugin example that indexes a single field with a single
value.
- Author:
- John Weatherley
- See Also:
FileIndexingServiceWriter
Method Summary |
void |
addFields(File file,
org.apache.lucene.document.Document newDoc,
org.apache.lucene.document.Document existingDoc,
String docType,
String docGroup)
Indexes a single field 'simplePluginDataIsPluggedIn' with the value 'true'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleFileIndexingPlugin
public SimpleFileIndexingPlugin()
addFields
public void addFields(File file,
org.apache.lucene.document.Document newDoc,
org.apache.lucene.document.Document existingDoc,
String docType,
String docGroup)
throws Exception
- Indexes a single field 'simplePluginDataIsPluggedIn' with the value 'true'.
The index may be searched using this field/value to determine which records
have been indexed using this plugin.
- Specified by:
addFields
in interface FileIndexingPlugin
- Parameters:
file
- The file that is being indexednewDoc
- The new Lucene Document that will be inserted in the index for
this fileexistingDoc
- The previous Lucene Document that existed for this record, or
null if not availabledocType
- The docType for this file, for example 'adn', 'dlese_collect'
(equivalent to XML format in the DLESE metadata repository)docGroup
- The docGroup associated with this file, for example 'dcc',
'comet', or null if none is associated (equivalent to the collection key in the DLESE metadata
repository)
- Throws:
Exception
- Exception should be thrown to index this Document as an error- See Also:
Document