Class SelectQueryDocumentModifier
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.searchindex.documentBuilding.SelectQueryDocumentModifier
-
- All Implemented Interfaces:
DocumentModifier,ContextModelsUser
- Direct Known Subclasses:
SelectQueryI18nDocumentModifier
public class SelectQueryDocumentModifier extends Object implements DocumentModifier, ContextModelsUser
Modify the document, adding the results of one or more select queries. If the individual qualifies, execute the queries and add the results to the specified search fields. If there are no specified search fields, ALLTEXT and ALLTEXTUNSTEMMED are assumed. An individual qualifies if it satisfies any of the type restrictions, or if there are no type restrictions. Each query should contain a ?uri variable, which will be replaced by the URI of the individual. All of the result fields of all result rows of all of the queries will be converted to strings and added to each of the specified search fields. A label may be supplied to the instance, for use in logging. If no label is supplied, one will be generated.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringlabelA name to be used in logging, to identify this instance.protected List<String>queriesThe queries to be executed.protected RDFServicerdfService
-
Constructor Summary
Constructors Constructor Description SelectQueryDocumentModifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddQuery(String query)voidaddTargetField(String fieldName)voidaddTypeRestriction(String typeUri)voidmodifyDocument(Individual ind, SearchInputDocument doc)Use the rules contained within this class to modify this search document, according to the characteristics of this individual.protected booleanpassesTypeRestrictions(Individual ind)voidsetContextModels(ContextModelAccess models)voidsetLabel(String l)voidshutdown()Called to inform the DocumentModifier that the system is shutting down.StringtoString()voidvalidate()
-
-
-
Field Detail
-
rdfService
protected RDFService rdfService
-
label
protected String label
A name to be used in logging, to identify this instance.
-
-
Method Detail
-
setContextModels
public void setContextModels(ContextModelAccess models)
- Specified by:
setContextModelsin interfaceContextModelsUser
-
setLabel
public void setLabel(String l)
-
addQuery
public void addQuery(String query)
-
addTargetField
public void addTargetField(String fieldName)
-
addTypeRestriction
public void addTypeRestriction(String typeUri)
-
validate
public void validate()
-
modifyDocument
public void modifyDocument(Individual ind, SearchInputDocument doc)
Description copied from interface:DocumentModifierUse the rules contained within this class to modify this search document, according to the characteristics of this individual.- Specified by:
modifyDocumentin interfaceDocumentModifier- Parameters:
ind- The individual that is being indexed. Will not be null.doc- The document as it stands so far. Will not be null.
-
passesTypeRestrictions
protected boolean passesTypeRestrictions(Individual ind)
-
shutdown
public void shutdown()
Description copied from interface:DocumentModifierCalled to inform the DocumentModifier that the system is shutting down.- Specified by:
shutdownin interfaceDocumentModifier
-
-