Class Processor
- java.lang.Object
-
- com.yahoo.searchdefinition.processing.Processor
-
- Direct Known Subclasses:
AddAttributeTransformToSummaryOfImportedFields
,AddExtraFieldsToDocument
,AdjustPositionSummaryFields
,AttributeProperties
,AttributesImplicitWord
,Bolding
,BuiltInFieldSets
,CreatePositionZCurve
,DisallowComplexMapAndWsetKeyTypes
,DiversitySettingsValidator
,ExactMatch
,FastAccessValidator
,FieldSetSettings
,FilterFieldNames
,ImplicitSummaries
,ImplicitSummaryFields
,ImportedFieldsResolver
,IndexFieldNames
,IndexingInputs
,IndexingOutputs
,IndexingValidation
,IndexingValues
,IntegerIndex2Attribute
,LiteralBoost
,MakeAliases
,MakeDefaultSummaryTheSuperSet
,MatchConsistency
,MatchedElementsOnlyResolver
,MatchPhaseSettingsValidator
,MultifieldIndexHarmonizer
,MutableAttributes
,NGramMatch
,OptimizeIlscript
,PredicateProcessor
,RankingExpressionTypeResolver
,RankProfileTypeSettingsProcessor
,ReferenceFieldsProcessor
,ReservedDocumentNames
,ReservedFunctionNames
,SearchMustHaveDocument
,SetLanguage
,SetRankTypeEmptyOnFilters
,SortingSettings
,StringSettingsOnNonStringFields
,SummaryConsistency
,SummaryDiskAccessValidator
,SummaryDynamicStructsArrays
,SummaryFieldsMustHaveValidSource
,SummaryNamesFieldCollisions
,TagType
,TensorFieldProcessor
,TextMatch
,UriHack
,UrlFieldValidator
,ValidateFieldTypes
,ValidateFieldWithIndexSettingsCreatesIndex
,WordMatch
public abstract class Processor extends java.lang.Object
Abstract superclass of all search definition processors.- Author:
- bratseth
-
-
Field Summary
Fields Modifier and Type Field Description protected com.yahoo.config.application.api.DeployLogger
deployLogger
protected QueryProfiles
queryProfiles
protected RankProfileRegistry
rankProfileRegistry
protected Search
search
-
Constructor Summary
Constructors Constructor Description Processor(Search search, com.yahoo.config.application.api.DeployLogger deployLogger, RankProfileRegistry rankProfileRegistry, QueryProfiles queryProfiles)
Base constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected SDField
addField(Search search, SDField field, java.lang.String suffix, java.lang.String indexing, java.lang.String queryCommand)
Convenience method for adding a no-strings-attached implementation field for a regular fieldvoid
fail(Search search, com.yahoo.document.Field field, java.lang.String msg)
protected java.lang.String
formatError(java.lang.String searchName, java.lang.String fieldName, java.lang.String msg)
protected java.util.Iterator<RankProfile.RankSetting>
matchingRankSettingsIterator(Search search, RankProfile.RankSetting.Type type)
Returns an iterator of all the rank settings with given type in all the rank profiles in this search definition.protected java.lang.RuntimeException
newProcessException(Search search, com.yahoo.document.Field field, java.lang.String msg)
protected java.lang.RuntimeException
newProcessException(java.lang.String searchName, java.lang.String fieldName, java.lang.String msg)
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.protected void
warn(Search search, com.yahoo.document.Field field, java.lang.String msg)
protected void
warn(java.lang.String searchName, java.lang.String fieldName, java.lang.String msg)
-
-
-
Field Detail
-
search
protected final Search search
-
deployLogger
protected com.yahoo.config.application.api.DeployLogger deployLogger
-
rankProfileRegistry
protected final RankProfileRegistry rankProfileRegistry
-
queryProfiles
protected final QueryProfiles queryProfiles
-
-
Constructor Detail
-
Processor
public Processor(Search search, com.yahoo.config.application.api.DeployLogger deployLogger, RankProfileRegistry rankProfileRegistry, QueryProfiles queryProfiles)
Base constructor- Parameters:
search
- the search to processdeployLogger
- 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 Detail
-
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)
-
addField
protected SDField addField(Search search, SDField field, java.lang.String suffix, java.lang.String indexing, java.lang.String queryCommand)
Convenience method for adding a no-strings-attached implementation field for a regular field- Parameters:
search
- the search definition in questionfield
- the field to add an implementation field forsuffix
- the suffix of the added implementation field (without the underscore)indexing
- the indexing statement of the fieldqueryCommand
- the query command of the original field, or null if none- Returns:
- the implementation field which is added to the search
-
matchingRankSettingsIterator
protected java.util.Iterator<RankProfile.RankSetting> matchingRankSettingsIterator(Search search, 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 java.lang.String formatError(java.lang.String searchName, java.lang.String fieldName, java.lang.String msg)
-
newProcessException
protected java.lang.RuntimeException newProcessException(java.lang.String searchName, java.lang.String fieldName, java.lang.String msg)
-
newProcessException
protected java.lang.RuntimeException newProcessException(Search search, com.yahoo.document.Field field, java.lang.String msg)
-
fail
public void fail(Search search, com.yahoo.document.Field field, java.lang.String msg)
-
warn
protected void warn(java.lang.String searchName, java.lang.String fieldName, java.lang.String msg)
-
warn
protected void warn(Search search, com.yahoo.document.Field field, java.lang.String msg)
-
-