|
DLESE Tools v1.6.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface FileIndexingPlugin
This Interface provides a mechanism for adding custom fields to Lucene index Documents that are being
created for a given file. Fields created using this Interface should use a unigue field name namespace
prefix to avoid field name conflicts. For information about adding fields, see the Lucene Document javadoc.
To configure one or more Lucene Analyzers to use on a per-field basis for your plugins, provide a
properties file within your application's class path named 'FileIndexingPluginLuceneAnalyzers.properties'
(used in the DDS, NCS, and DCS Web applications). See PerFieldAnalyzer
for details.
Example usage:
private static final String FIELD_NS = "MyMetaMetadata";
public void addFields(File file, Document newDoc, Document existingDoc)
throws Exception{
... code to set up data as needed ...
}
String recordStatus = myData.getRecordStatus();
newDoc.add(new Field(FIELD_NS + "recordStatus", recordStatus, Field.Store.YES, Field.Index.NOT_ANALYZED));
... add additional fields as needed ...
FileIndexingServiceWriter| Method Summary | |
|---|---|
void |
addFields(File file,
org.apache.lucene.document.Document newDoc,
org.apache.lucene.document.Document existingDoc,
String docType,
String docGroup)
This method may be used to add custom fields to a Lucene Document for a given file prior to it's being inserted into the index. |
| Method Detail |
|---|
void addFields(File file,
org.apache.lucene.document.Document newDoc,
org.apache.lucene.document.Document existingDoc,
String docType,
String docGroup)
throws Exception
FileIndexingServiceWriter after it has
completed adding it's fields to the Lucene Document.
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)
Exception - Exception should be thrown to index this Document as an errorDocument
|
DLESE Tools v1.6.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||