Class Processor

java.lang.Object
com.yahoo.schema.processing.Processor
Direct Known Subclasses:
AddAttributeTransformToSummaryOfImportedFields, AddExtraFieldsToDocument, AdjustPositionSummaryFields, AttributeProperties, AttributesImplicitWord, Bolding, BoolAttributeValidator, BuiltInFieldSets, CreatePositionZCurve, DictionaryProcessor, DisallowComplexMapAndWsetKeyTypes, DiversitySettingsValidator, ExactMatch, FastAccessValidator, FieldSetSettings, FilterFieldNames, ImplicitSummaries, ImplicitSummaryFields, ImportedFieldsResolver, IndexFieldNames, IndexingInputs, IndexingOutputs, IndexingValidation, IndexingValues, IntegerIndex2Attribute, LiteralBoost, MakeAliases, MakeDefaultSummaryTheSuperSet, MatchConsistency, MatchedElementsOnlyResolver, MatchPhaseSettingsValidator, MultifieldIndexHarmonizer, MutableAttributes, NGramMatch, OnnxModelConfigGenerator, OnnxModelTypeResolver, OptimizeIlscript, PagedAttributeValidator, PredicateProcessor, RankingExpressionTypeResolver, RankProfileTypeSettingsProcessor, ReferenceFieldsProcessor, ReservedDocumentNames, ReservedFunctionNames, SearchMustHaveDocument, SetRankTypeEmptyOnFilters, SortingSettings, StringSettingsOnNonStringFields, SummaryConsistency, SummaryDiskAccessValidator, SummaryDynamicStructsArrays, SummaryFieldsMustHaveValidSource, SummaryNamesFieldCollisions, SummaryTransformForDocumentId, TagType, TensorFieldProcessor, TextMatch, UriHack, UrlFieldValidator, ValidateFieldTypes, ValidateFieldWithIndexSettingsCreatesIndex, ValidateStructTypeInheritance, WordMatch

public abstract class Processor extends Object
Abstract superclass of all search definition processors.
Author:
bratseth
  • Field Details

    • schema

      protected final Schema schema
    • deployLogger

      protected final com.yahoo.config.application.api.DeployLogger deployLogger
    • rankProfileRegistry

      protected final RankProfileRegistry rankProfileRegistry
    • queryProfiles

      protected final QueryProfiles queryProfiles
  • Constructor Details

    • Processor

      public Processor(Schema schema, com.yahoo.config.application.api.DeployLogger deployLogger, RankProfileRegistry rankProfileRegistry, QueryProfiles queryProfiles)
      Base constructor
      Parameters:
      schema - the search to process
      deployLogger - Logger du use when logging deploy output.
      rankProfileRegistry - Registry with all rank profiles, used for lookup and insertion.
      queryProfiles - The query profiles contained in the application this search is part of.
  • Method Details

    • process

      public abstract void process(boolean validate, boolean documentsOnly)
      Processes the input search definition by modifying the input search and its documents, and returns the input search definition.
      Parameters:
      validate - true to throw exceptions on validation errors, false to make the best possible effort at completing processing without throwing an exception. If we are not validating, emitting warnings have no effect and can (but must not) be skipped.
      documentsOnly - true to skip processing (including validation, regardless of the validate setting) of aspects not relating to document definitions (e.g rank profiles)
    • process

      public void process(boolean validate, boolean documentsOnly, com.yahoo.config.model.api.ModelContext.Properties properties)
      As above, possibly with properties from a context. Override if needed.
    • addField

      protected SDField addField(Schema schema, SDField field, String suffix, String indexing, String queryCommand)
      Convenience method for adding a no-strings-attached implementation field for a regular field
      Parameters:
      schema - the search definition in question
      field - the field to add an implementation field for
      suffix - the suffix of the added implementation field (without the underscore)
      indexing - the indexing statement of the field
      queryCommand - the query command of the original field, or null if none
      Returns:
      the implementation field which is added to the search
    • matchingRankSettingsIterator

      protected Iterator<RankProfile.RankSetting> matchingRankSettingsIterator(Schema schema, RankProfile.RankSetting.Type type)
      Returns an iterator of all the rank settings with given type in all the rank profiles in this search definition.
    • formatError

      protected String formatError(String schemaName, String fieldName, String msg)
    • newProcessException

      protected RuntimeException newProcessException(String schemaName, String fieldName, String msg)
    • newProcessException

      protected RuntimeException newProcessException(Schema schema, com.yahoo.document.Field field, String msg)
    • fail

      public void fail(Schema schema, com.yahoo.document.Field field, String msg)
    • warn

      protected void warn(String schemaName, String fieldName, String message)
    • warn

      protected void warn(Schema schema, com.yahoo.document.Field field, String message)
    • info

      protected void info(String schemaName, String fieldName, String message)
    • info

      protected void info(Schema schema, com.yahoo.document.Field field, String message)