Class 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 Detail

      • label

        protected String label
        A name to be used in logging, to identify this instance.
      • queries

        protected List<String> queries
        The queries to be executed. There must be at least one.
    • Constructor Detail

      • SelectQueryDocumentModifier

        public SelectQueryDocumentModifier()
    • Method Detail

      • 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: DocumentModifier
        Use the rules contained within this class to modify this search document, according to the characteristics of this individual.
        Specified by:
        modifyDocument in interface DocumentModifier
        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: DocumentModifier
        Called to inform the DocumentModifier that the system is shutting down.
        Specified by:
        shutdown in interface DocumentModifier