Package com.yahoo.schema.parser
Class SchemaParser
java.lang.Object
com.yahoo.schema.parser.SchemaParser
- All Implemented Interfaces:
SchemaParserConstants
The schema parser
NOTE: When this grammar is changed, also change integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf
- Author:
- bratseth
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface com.yahoo.schema.parser.SchemaParserConstants
ADJUST_TARGET, ALIAS, ALLOW_DROP_ALL, ALWAYS, ANNOTATION, ANNOTATIONREFERENCE, APPROXIMATE_THRESHOLD, ARITY, ARRAY, AS, ASCENDING, ATTRIBUTE, BOLDING, BRACE_ML_CONTENT, BRACE_ML_LEVEL_1, BRACE_ML_LEVEL_2, BRACE_ML_LEVEL_3, BRACE_SL_CONTENT, BRACE_SL_LEVEL_1, BRACE_SL_LEVEL_2, BRACE_SL_LEVEL_3, BTREE, CASED, COLON, COMMA, CONSTANT, CONSTANTS, CONTEXT, CREATE_IF_NONEXISTENT, CUTOFF_FACTOR, CUTOFF_STRATEGY, DEFAULT, DENSE_POSTING_LIST_THRESHOLD, DESCENDING, DICTIONARY, DIRECT, DISTANCE_METRIC, DIVERSITY, DOCUMENT, DOCUMENT_SUMMARY, DOT, DOUBLE, DOUBLE_KEYWORD, DOUBLEQUOTEDSTRING, DYNAMIC, ELEMENT_GAP, ENABLE_BIT_VECTORS, ENABLE_BM25, ENABLE_ONLY_BIT_VECTOR, EOF, EVALUATION_POINT, EXACT, EXACT_TERMINATOR, EXECUTION_MODE, EXPLORATION_SLACK, EXPRESSION_ML, EXPRESSION_SL, FALSE, FAST_ACCESS, FAST_RANK, FAST_SEARCH, FIELD, FIELDS, FIELDSET, FILE, FILE_PATH, FILTER, FILTER_FIRST_EXPLORATION, FILTER_FIRST_THRESHOLD, FILTER_THRESHOLD, FIRST_PHASE, FLOAT_KEYWORD, FROM_DISK, FULL, FUNCTION, GLOBAL_PHASE, GPU_DEVICE, GRAM, GRAM_SIZE, GREATERTHAN, HASH, HNSW, HTTP, ID, IDENTICAL, IDENTIFIER, IDENTIFIER_WITH_DASH, IGNORE_DEFAULT_RANK_FEATURES, IMPORT, INDEX, INDEXING, INFINITY, INHERITS, INLINE, INPUTS, INTEGER, INTEROP_THREADS, INTRAOP_THREADS, KEEP_RANK_COUNT, LBRACE, LESSTHAN, LITERAL, LOCALE, LONG, LONG_KEYWORD, LOOSE, LOWER_BOUND, LOWERCASE, MACRO, MAP, MATCH, MATCH_PHASE, MATCHED_ELEMENTS_ONLY, MATCHFEATURES_ML, MATCHFEATURES_ML_INHERITS, MATCHFEATURES_SL, MAX_FILTER_COVERAGE, MAX_HITS, MAX_LENGTH, MAX_LINKS_PER_NODE, MAX_OCCURRENCES, MAX_TOKEN_LENGTH, MIN_GROUPS, MIN_HITS_PER_THREAD, MODEL, MTOKEN, MULTI_THREADED_INDEXING, MUTABLE, MUTATE, NEIGHBORS_TO_EXPLORE_AT_INSERT, NEVER, NL, NONE, NORMAL, NORMALIZING, NUM_SEARCH_PARTITIONS, NUM_THREADS_PER_SEARCH, OFF, OMIT_SUMMARY_FEATURES, ON, ON_DEMAND, ON_FIRST_PHASE, ON_MATCH, ON_SECOND_PHASE, ON_SUMMARY, ONNX_INPUT_SL, ONNX_MODEL, ONNX_OUTPUT_SL, OPERATION, ORDER, PAGED, PARALLEL, POST_FILTER_THRESHOLD, PRE_POST_FILTER_TIPPING_POINT, PREFIX, PRIMARY, PROPERTIES, QUATERNARY, QUERY, QUERY_COMMAND, QUESTIONMARK, RANK, RANK_PROFILE, RANK_PROPERTIES, RANK_SCORE_DROP_LIMIT, RANK_TYPE, RANKFEATURES_ML, RANKFEATURES_SL, RAW, RAW_AS_BASE64_IN_SUMMARY, RBRACE, REFERENCE, REMOVE_IF_ZERO, RERANK_COUNT, SCHEMA, SEARCH, SEARCHLIB_SKIP, SECOND_PHASE, SECONDARY, SELECT_ELEMENTS_BY_SL, SEQUENTIAL, SIGNIFICANCE, SINGLE_LINE_COMMENT, SINGLEQUOTEDSTRING, SORTING, SOURCE, SSCONTEXTUAL, SSOVERRIDE, SSTITLE, SSURL, STATIC, STEMMING, STOPWORD_LIMIT, STRENGTH, STRICT, STRING, STRING_KEYWORD, STRUCT, STRUCT_FIELD, SUBSTRING, SUFFIX, SUMMARY, SUMMARY_TO, SUMMARYFEATURES_ML, SUMMARYFEATURES_ML_INHERITS, SUMMARYFEATURES_SL, SYMMETRIC, TARGET_HITS_MAX_ADJUSTMENT_FACTOR, TENSOR_TYPE, TENSOR_VALUE_ML, TENSOR_VALUE_SL, TERMWISE_LIMIT, TERTIARY, TEXT, TO, tokenImage, TOKENS, TRUE, TYPE, UCA, UNCASED, UPPER_BOUND, URI, URI_PATH, USE_MODEL, VARIABLE, WEAKAND, WEIGHT, WEIGHTEDSET, WORD -
Constructor Summary
ConstructorsConstructorDescriptionSchemaParser(CharStream stream) Constructor with user supplied CharStream.Constructor with generated Token Manager.SchemaParser(SimpleCharStream stream, com.yahoo.config.application.api.DeployLogger deployLogger) Creates a parser. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidalias(ParsedField field) final voidannotation(ParsedDocument document) Consumes an annotation block from within a document elementfinal voidConsumes a single element of an annotation body block.final voidannotationOutside(ParsedSchema schema) This rule consumes a annotation block from within a schema element.final ParsedTypefinal voidapproximateThreshold(ParsedRankProfile profile) This rule consumes an approximate-threshold statement for a rank profile.final voidarrayTensorValues(List<Double> values) Tensor array values.final voidattribute(ParsedField field) This rule consumes an attribute statement of a field element.final voidattributeSetting(ParsedAttribute attribute) This rule consumes a single attribute setting statement of an attribute element.final voidattributeSorting(ParsedAttribute attribute) final voidbolding(ParsedField field) This rule consumes a bolding statement of a field element.final Booleanbool()A boolean value.final voidconstant(ParsedSchema schema, ParsedRankProfile profile) final com.yahoo.searchlib.rankingexpression.ReferenceReturns the reference "constant(name)" for both "constant(name)" and "name".final voidconstants(ParsedSchema schema, ParsedRankProfile profile) Consumes a set of constants available in ranking expressions in the enclosing profile.final voidconstantTensor(ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) final StringconstantTensorErrorMessage(String rankProfileName, com.yahoo.searchlib.rankingexpression.Reference name) final voidconstantValue(ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) final ParsedTypedataType()This rule consumes a data type block from within a field element.final voiddictionary(ParsedField field) This rule consumes a dictionary statement of a field element.final voiddictionarySetting(ParsedField field) final voidDisable tracing.final voiddiversity(ParsedRankProfile profile) This rule consumes a diversity block of a rank profile.final voiddiversityDeprecated(ParsedRankProfile profile) final voiddiversityItem(RankProfile.DiversitySettings settings) final voiddocument(ParsedSchema schema) Consumes a document element.final voiddocumentBody(ParsedDocument document) Consumes a document body blockfinal voiddocumentSummary(ParsedSchema schema) Consumes a document-summary block from within a schema block.final voiddocumentSummaryItem(ParsedDocumentSummary summary) Consumes a single document-summary item.final ElementGapfinal voidEnable tracing.final voidexactTerminator(ParsedMatchSettings matchInfo) final voidexplorationSlack(ParsedRankProfile profile) This rule consumes an exploration-slack statement for a rank profile.final StringThis rule consumes an expression token and returns its image.final ParsedFieldfield()Consumes a field blockfinal voidfieldBody(ParsedField field) This rule consumes a single element of a field body block.final voidfieldInsideDoc(ParsedDocument document) Consumes a field block from within a document element.final voidfieldOutsideDoc(ParsedSchema schema) Consumes a field block from outside a document element.final voidfieldRankFilter(ParsedRankProfile profile) Consumes a rank filter statement of a rank profile.final voidfieldRankItem(ParsedRankProfile profile, String field) final voidfieldRankType(ParsedRankProfile profile) Consumes a rank-type statement of a rank profile.final voidfieldSet(ParsedSchema schema) Consumes a fieldset blockfinal voidfieldSorting(ParsedField field) final voidfieldStemming(ParsedField field) This rule consumes a stemming block of a field element.final voidfieldWeight(ParsedRankProfile profile) Consumes a field-weight statement of a rank profile.final StringfileItem()final voidfilterFirstExploration(ParsedRankProfile profile) This rule consumes a filter-first-exploration statement for a rank profile.final voidfilterFirstThreshold(ParsedRankProfile profile) This rule consumes a filter-first-threshold statement for a rank profile.final voidfilterThreshold(ParsedRankProfile profile) final voidfirstPhase(ParsedRankProfile profile) Consumes the first-phase block of a rank profile.final voidfirstPhaseItem(ParsedRankProfile profile) final doubleConsumes a floating-point token and returns its numeric value.final voidfunction(ParsedRankProfile profile) This rule consumes a function statement of a rank-profile.Generate ParseException.final Tokenfinal TokengetToken(int index) final voidglobalPhase(ParsedRankProfile profile) Consumes the global-phase block of a rank profile.final voidglobalPhaseItem(ParsedRankProfile profile) Consumes a statement for a global-phase block.final voidgramSize(ParsedMatchSettings matchInfo) final voidhnswIndex(ParsedIndex index) final voidhnswIndexBody(HnswIndexParams.Builder params) final voidid(ParsedField field) Consumes an id statement of a field body block.final StringConsumes an identifier.final Stringfinal voidignoreRankFeatures(ParsedRankProfile profile) This rule consumes a ignore-default-rank-features statement for a rank profile.final voidimportField(ParsedSchema schema) final voidindexBody(ParsedIndex index) Consumes a single index statement for an index block.final voidindexedTensorBlockValues(com.yahoo.tensor.TensorAddress mappedAddress, com.yahoo.tensor.Tensor.Builder builder) final voidindexedTensorValue(List<Double> values) final voidindexedTensorValues(com.yahoo.tensor.Tensor.Builder builder) final voidindexing(ParsedField field) This rule consumes an indexing block of a field element.final voidindexingOperation(ParsedField field, boolean multiLine) This rule consumes an IL script block.final voidindexInsideField(ParsedField field) Consumes an index block for a field element.final voidindexOutsideDoc(ParsedSchema schema) Consumes an index block in a schema element.final voidinheritsAnnotation(ParsedAnnotation annotation) final voidinheritsDocument(ParsedDocument document) Consumes a document inheritance statement.final voidinheritsDocumentSummary(ParsedDocumentSummary documentSummary) This rule consumes an inherits statement of a document summary.final voidinheritsRankProfile(ParsedRankProfile profile) Consumes an inherits statement of a rank-profile.final voidinheritsStruct(ParsedStruct struct) Consumes struct inheritancefinal booleaninline()final com.yahoo.searchlib.rankingexpression.Referenceinput(ParsedRankProfile profile) final com.yahoo.searchlib.rankingexpression.ReferenceReturns the reference "query(name)" for both "query(name)" and "name".final voidinputs(ParsedRankProfile profile) Consumes an inputs block of a rank profile.final intinteger()Consumes an integer token and returns its numeric value.final voidlbrace()Consumes an opening brace with leading and trailing newline tokens.final longConsumes a long or integer token and returns its numeric value.final ParsedTypefinal voidmappedTensorBlock(com.yahoo.tensor.Tensor.Builder builder) final voidmappedTensorCellValue(com.yahoo.tensor.TensorAddress address, com.yahoo.tensor.Tensor.Builder builder) final voidmappedTensorValue(com.yahoo.tensor.Tensor.Builder builder) A mapped or mixed tensor value.final voidmatchFeatures(ParsedRankProfile profile) Consumes a match-features block of a rank profile.final voidmatchItem(ParsedMatchSettings matchInfo) This rule consumes a single match item for a match block.final voidmatchPhase(ParsedRankProfile profile) This rule consumes a match-phase block of a rank profile.final voidmatchPhaseItem(ParsedRankProfile profile, RankProfile.MatchPhaseSettings settings) final voidmatchSettings(ParsedMatchSettings matchInfo) final voidmatchSize(ParsedMatchSettings matchInfo) final voidmatchType(ParsedMatchSettings matchInfo) final voidmaxTermOccurrences(ParsedMatchSettings matchInfo) final voidmaxTokenLength(ParsedMatchSettings matchInfo) final voidminHitsPerThread(ParsedRankProfile profile) This rule consumes a min-hits-per-thread statement for a rank profile.final voidmutate(ParsedRankProfile profile) This rule consumes an mutate statement of a rank-profile.final Stringfinal voidmutate_operation(ParsedRankProfile profile) final ParsedDocumentConsumes a document element, explicitly namedfinal voidnormalizing(ParsedField field) This rule consumes a normalizing statement of a field element.final Numbernumber()final voidnumSearchPartitions(ParsedRankProfile profile) This rule consumes a num-search-partitions statement for a rank profile.final voidnumThreadsPerSearch(ParsedRankProfile profile) This rule consumes a num-threads-per-search statement for a rank profile.final OnnxModelConsumes an onnx-model block.final voidonnxModelInProfile(ParsedRankProfile profile) final voidonnxModelInSchema(ParsedSchema schema) final voidonnxModelItem(OnnxModel onnxModel) Consumes an onnx-model block.final voidpostFilterThreshold(ParsedRankProfile profile) This rule consumes a post-filter-threshold statement for a rank profile.final voidqueryCommand(ParsedField field) final StringConsumes a quoted string token and returns the token image minus the quotes.final voidrank(ParsedField field) Consumes a rank statement of a field element.final voidrankFeatures(ParsedRankProfile profile) Consumes a rank-features block of a rank profilefinal voidrankingConstant(ParsedSchema schema) Consumes a constant block of a schema element.final Stringfinal voidrankProfile(ParsedSchema schema) Consumes a rank-profile block of a schema element.final voidrankProfileItem(ParsedSchema schema, ParsedRankProfile profile) This rule consumes a single statement for a rank-profile block.final voidrankProperties(ParsedRankProfile profile) Consumes a rank-properties block of a rank profile.final voidrankProperty(ParsedRankProfile profile) Consumes a single rank property pair for a rank profile.final StringConsumes a single rank property for a rank-properties block.final voidrankSetting(ParsedField field) Consumes a single rank setting of a rank statement.final voidrankType(ParsedField field) This rule consumes a rank-type statement of a field element.final voidrawAsBase64(ParsedSchema schema) final ParsedTypevoidReInit(CharStream stream) Reinitialise.voidReinitialisefinal ParsedSchemaConsumes a schema definition that contains only documents to be used for inheritance, etc.final ParsedSchemarootDocumentItem(ParsedSchema schema) Consumes a single item from within a root document node.final ParsedSchemaThis rule consumes a proper schema block.final voidrootSchemaItem(ParsedSchema schema) Consumes an element of a schema block.final ParsedSchemaschema()The rule consumes any schema and returns the corresponding object.final voidsearchStemming(ParsedSchema schema) This rule consumes a stemming statement for a schema element.final voidsecondPhase(ParsedRankProfile profile) Consumes the second-phase block of a rank profile.final voidsecondPhaseItem(ParsedRankProfile profile) Consumes a statement for a second-phase block.final voidsignificance(ParsedRankProfile profile) final voidsignificanceItem(ParsedRankProfile profile) final voidsorting(ParsedSorting sort) final voidsortingSetting(ParsedSorting sorting) final voidstrict(ParsedRankProfile profile) final Stringstring()Consumes a string token and returns the token image.final ParsedStructThis rule consumes a struct declaration blockfinal voidstructField(ParsedField field) This rule consumes a struct subfield from a document field body.final voidstructFieldBody(ParsedField field) This rule consumes a single element of a struct subfield body block.final voidstructFieldDefinition(ParsedStruct struct) This rule consumes a field block of a struct body.final voidstructInside(ParsedDocument document) This rule consumes a struct block from within a document element.final voidstructOutside(ParsedSchema schema) This rule consumes a struct block from within a schema element.final voidsummaryBolding(ParsedSummaryField field) This rule consumes a bolding statement for a summary field element.final voidThis rule consumes a destination-list statement for a summary field element.final voidfinal voidfinal voidsummaryFeatures(ParsedRankProfile profile) Consumes a summary-features block of a rank profile.final voidThis rule consumes a summary statement defined inside a document-summary block.final voidsummaryInField(ParsedField field) The rule consumes a summary statement defined inside a field.final voidsummaryInFieldLong(ParsedField field) This rule consumes a multi-line summary field.final voidsummaryInFieldShort(ParsedField field) This rule consumes a single-line summary field.final voidsummaryItem(ParsedSummaryField field) This rule consumes an item of a summary field block.final voidThis rule consumes a source-list statement for a summary field element.final voidsummaryTo(ParsedField field) This rule consumes a summary-to statement of a field element.final voidThis rule consumes a transform statement for a summary field element.final voidThis rule consumes a target-hits-max-adjustment-factor statement for a rank profile.final com.yahoo.tensor.TensorAddresstensorAddress(com.yahoo.tensor.TensorType type) final voidtensorAddressElement(com.yahoo.tensor.TensorAddress.Builder builder) final Stringfinal doublefinal com.yahoo.tensor.TensorTypetensorType(String errorMessage) final com.yahoo.tensor.TensorTypetensorTypeWithPrefix(String errorMessage) final com.yahoo.tensor.TensortensorValue(com.yahoo.tensor.TensorType type) Parses a tensor written in a tensor literal form, https://docs.vespa.ai/en/reference/tensor.html#tensor-literal-formfinal StringUndocumented syntax for supplying a tensor constant value by a string prefixed by "value"final voidtermwiseLimit(ParsedRankProfile profile) This rule consumes a termwise-limit statement for a rank profile.final booleanfinal StringuriItem()final com.yahoo.search.schema.RankProfile.InputTypevalueType(com.yahoo.searchlib.rankingexpression.Reference reference) final voidweakand(ParsedRankProfile profile) final voidweakandAdjustTarget(ParsedRankProfile profile) final voidweakandAllowDropAll(ParsedRankProfile profile) final voidweakandItem(ParsedRankProfile profile) final voidweakandStopwordLimit(ParsedRankProfile profile) final voidweight(ParsedField field) This rule consumes a weight statement of a field element.final voidweightedset(ParsedType fieldType) This rule consumes a weighted set statement of a field element.final voidweightedsetBody(ParsedType type) This rule consumes one body item of a weighted set block.
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
SchemaParser
public SchemaParser(SimpleCharStream stream, com.yahoo.config.application.api.DeployLogger deployLogger) Creates a parser. -
SchemaParser
Constructor with user supplied CharStream.- Parameters:
stream- stream to init with
-
SchemaParser
Constructor with generated Token Manager.- Parameters:
tm- Token manager to use
-
-
Method Details
-
schema
The rule consumes any schema and returns the corresponding object. This is the only production that should ever consume leading newlines.- Returns:
- the schema object
- Throws:
ParseException
-
rootSchema
This rule consumes a proper schema block. This and rootDocument() are the only rules that should ever consume trailing newline tokens.- Returns:
- the schema definition object.
- Throws:
ParseException
-
rootSchemaItem
Consumes an element of a schema block. This and rootSearch() are the only rules that should ever consume trailing newline tokens.- Parameters:
schema- the schema object to modify.- Throws:
ParseException
-
rootDocument
Consumes a schema definition that contains only documents to be used for inheritance, etc.- Returns:
- the schema definition object.
- Throws:
ParseException
-
rootDocumentItem
Consumes a single item from within a root document node.- Parameters:
schema- the schema object to modify.- Throws:
ParseException
-
document
Consumes a document element. The name defaults to the schema's name, but may be set.- Parameters:
schema- the schema object to add content to.- Throws:
ParseException
-
namedDocument
Consumes a document element, explicitly named- Throws:
ParseException
-
documentBody
Consumes a document body block- Parameters:
document- the document type to modify.- Throws:
ParseException
-
rawAsBase64
- Throws:
ParseException
-
inheritsStruct
Consumes struct inheritance- Parameters:
struct- The struct type to modify.- Throws:
ParseException
-
inheritsDocument
Consumes a document inheritance statement.- Parameters:
document- The document type to modify.- Throws:
ParseException
-
fieldInsideDoc
Consumes a field block from within a document element.- Parameters:
document- the document type to modify- Throws:
ParseException
-
fieldOutsideDoc
Consumes a field block from outside a document element.- Parameters:
schema- the schema to modify- Throws:
ParseException
-
field
Consumes a field block- Throws:
ParseException
-
fieldSet
Consumes a fieldset block- Throws:
ParseException
-
annotationOutside
This rule consumes a annotation block from within a schema element.- Parameters:
schema- the schema object to add content to- Throws:
ParseException
-
annotation
Consumes an annotation block from within a document element- Parameters:
document- the document object to add content to- Throws:
ParseException
-
annotationBody
Consumes a single element of an annotation body block.- Throws:
ParseException
-
inheritsAnnotation
- Throws:
ParseException
-
structInside
This rule consumes a struct block from within a document element.- Parameters:
document- the document object to add content to- Throws:
ParseException
-
structOutside
This rule consumes a struct block from within a schema element.- Parameters:
schema- the schema object to add content to- Throws:
ParseException
-
structDefinition
This rule consumes a struct declaration block- Throws:
ParseException
-
dataType
This rule consumes a data type block from within a field element.- Returns:
- the consumed data type
- Throws:
ParseException
-
referenceType
- Throws:
ParseException
-
annotationRefDataType
- Throws:
ParseException
-
mapDataType
- Throws:
ParseException
-
structFieldDefinition
This rule consumes a field block of a struct body.- Parameters:
struct- The struct to modify.- Throws:
ParseException
-
structField
This rule consumes a struct subfield from a document field body. This is not to be confused with a document struct's fields, but rather this is a subfield of a document field of type struct.- Parameters:
field- the field to modify- Throws:
ParseException
-
fieldBody
This rule consumes a single element of a field body block.- Parameters:
field- the field being built- Throws:
ParseException
-
structFieldBody
This rule consumes a single element of a struct subfield body block. Only elements that are supported in streaming schema and indexed schema (with complex attributes) are allowed.- Parameters:
field- the field being built- Throws:
ParseException
-
indexing
This rule consumes an indexing block of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
indexingOperation
This rule consumes an IL script block. This is expected to consume trailing newlines.- Parameters:
field- The field to modify.- Throws:
ParseException
-
summaryTo
This rule consumes a summary-to statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
weight
This rule consumes a weight statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
weightedset
This rule consumes a weighted set statement of a field element.- Parameters:
fieldType- The field type to modify.- Throws:
ParseException
-
weightedsetBody
This rule consumes one body item of a weighted set block.- Parameters:
type- The field type to modify.- Throws:
ParseException
-
rankType
This rule consumes a rank-type statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
attribute
This rule consumes an attribute statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
fieldSorting
- Throws:
ParseException
-
attributeSorting
- Throws:
ParseException
-
sorting
- Throws:
ParseException
-
sortingSetting
- Throws:
ParseException
-
attributeSetting
This rule consumes a single attribute setting statement of an attribute element.- Parameters:
attribute- The attribute to change.- Throws:
ParseException
-
summaryInDocument
This rule consumes a summary statement defined inside a document-summary block.- Parameters:
docsum- The document summary to modify.- Throws:
ParseException
-
summaryInField
The rule consumes a summary statement defined inside a field.- Parameters:
field- The field to modify.- Throws:
ParseException
-
summaryInFieldShort
This rule consumes a single-line summary field.- Throws:
ParseException
-
summaryInFieldLong
This rule consumes a multi-line summary field.- Throws:
ParseException
-
summaryItem
This rule consumes an item of a summary field block.- Parameters:
field- The field to modify.- Throws:
ParseException
-
summaryTransform
This rule consumes a transform statement for a summary field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
summaryElementsSelection
- Throws:
ParseException
-
summaryElementsBy
- Throws:
ParseException
-
summaryBolding
This rule consumes a bolding statement for a summary field element.- Parameters:
field- The summary field to modify.- Throws:
ParseException
-
summarySourceList
This rule consumes a source-list statement for a summary field element.- Parameters:
field- The summary field to modify.- Throws:
ParseException
-
summaryDestinationList
This rule consumes a destination-list statement for a summary field element.- Parameters:
field- The summary field to modify.- Throws:
ParseException
-
fieldStemming
This rule consumes a stemming block of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
searchStemming
This rule consumes a stemming statement for a schema element.- Parameters:
schema- the schema to modify- Throws:
ParseException
-
normalizing
This rule consumes a normalizing statement of a field element. At the moment, this can only be used to turn off normalizing.- Parameters:
field- The field to modify.- Throws:
ParseException
-
bolding
This rule consumes a bolding statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
dictionary
This rule consumes a dictionary statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
dictionarySetting
- Throws:
ParseException
-
queryCommand
- Throws:
ParseException
-
alias
- Throws:
ParseException
-
matchSettings
- Throws:
ParseException
-
matchType
- Throws:
ParseException
-
matchItem
This rule consumes a single match item for a match block.- Parameters:
matchInfo- The settings to modify.- Throws:
ParseException
-
exactTerminator
- Throws:
ParseException
-
gramSize
- Throws:
ParseException
-
matchSize
- Throws:
ParseException
-
maxTermOccurrences
- Throws:
ParseException
-
maxTokenLength
- Throws:
ParseException
-
rank
Consumes a rank statement of a field element.- Parameters:
field- The field to modify.- Throws:
ParseException
-
rankSetting
Consumes a single rank setting of a rank statement.- Parameters:
field- The field to modify.- Throws:
ParseException
-
id
Consumes an id statement of a field body block.- Parameters:
field- The field to modify.- Throws:
ParseException
-
documentSummary
Consumes a document-summary block from within a schema block.- Parameters:
schema- the schema object to add content to- Throws:
ParseException
-
inheritsDocumentSummary
public final void inheritsDocumentSummary(ParsedDocumentSummary documentSummary) throws ParseException This rule consumes an inherits statement of a document summary.- Parameters:
documentSummary- the document summary to modify- Throws:
ParseException
-
documentSummaryItem
Consumes a single document-summary item.- Parameters:
summary- The document summary to modify.- Throws:
ParseException
-
indexOutsideDoc
Consumes an index block in a schema element.- Parameters:
schema- the schema object to add content to- Throws:
ParseException
-
indexInsideField
Consumes an index block for a field element.- Parameters:
field- the field to modify- Throws:
ParseException
-
indexBody
Consumes a single index statement for an index block.- Parameters:
index- The index to modify.- Throws:
ParseException
-
hnswIndex
- Throws:
ParseException
-
hnswIndexBody
- Throws:
ParseException
-
onnxModelInSchema
- Throws:
ParseException
-
onnxModelInProfile
- Throws:
ParseException
-
onnxModel
Consumes an onnx-model block.- Throws:
ParseException
-
onnxModelItem
Consumes an onnx-model block.- Parameters:
onnxModel- the onnxModel to modify- Throws:
ParseException
-
rankingConstant
Consumes a constant block of a schema element.- Parameters:
schema- the schema object to add content to- Throws:
ParseException
-
fileItem
- Throws:
ParseException
-
uriItem
- Throws:
ParseException
-
rankingConstantErrorMessage
- Throws:
ParseException
-
rankProfile
Consumes a rank-profile block of a schema element.- Parameters:
schema- the schema object to add content to- Throws:
ParseException
-
rankProfileItem
public final void rankProfileItem(ParsedSchema schema, ParsedRankProfile profile) throws ParseException This rule consumes a single statement for a rank-profile block.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
inheritsRankProfile
Consumes an inherits statement of a rank-profile.- Parameters:
profile- the profile to modify- Throws:
ParseException
-
mutate
This rule consumes an mutate statement of a rank-profile.- Parameters:
profile- The profile to modify.- Throws:
ParseException
-
mutate_operation
- Throws:
ParseException
-
mutate_expr
- Throws:
ParseException
-
function
This rule consumes a function statement of a rank-profile.- Parameters:
profile- The profile to modify.- Throws:
ParseException
-
inline
- Throws:
ParseException
-
matchPhase
This rule consumes a match-phase block of a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
matchPhaseItem
public final void matchPhaseItem(ParsedRankProfile profile, RankProfile.MatchPhaseSettings settings) throws ParseException - Throws:
ParseException
-
diversity
This rule consumes a diversity block of a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
diversityDeprecated
- Throws:
ParseException
-
diversityItem
- Throws:
ParseException
-
firstPhase
Consumes the first-phase block of a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
firstPhaseItem
- Throws:
ParseException
-
secondPhase
Consumes the second-phase block of a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
secondPhaseItem
Consumes a statement for a second-phase block.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
globalPhase
Consumes the global-phase block of a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
globalPhaseItem
Consumes a statement for a global-phase block.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
inputs
Consumes an inputs block of a rank profile.- Throws:
ParseException
-
input
public final com.yahoo.searchlib.rankingexpression.Reference input(ParsedRankProfile profile) throws ParseException - Throws:
ParseException
-
inputName
Returns the reference "query(name)" for both "query(name)" and "name".- Throws:
ParseException
-
valueType
public final com.yahoo.search.schema.RankProfile.InputType valueType(com.yahoo.searchlib.rankingexpression.Reference reference) throws ParseException - Throws:
ParseException
-
summaryFeatures
Consumes a summary-features block of a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
strict
- Throws:
ParseException
-
significance
- Throws:
ParseException
-
significanceItem
- Throws:
ParseException
-
weakand
- Throws:
ParseException
-
weakandItem
- Throws:
ParseException
-
weakandStopwordLimit
- Throws:
ParseException
-
weakandAllowDropAll
- Throws:
ParseException
-
weakandAdjustTarget
- Throws:
ParseException
-
filterThreshold
- Throws:
ParseException
-
matchFeatures
Consumes a match-features block of a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
rankFeatures
Consumes a rank-features block of a rank profile- Throws:
ParseException
-
ignoreRankFeatures
This rule consumes a ignore-default-rank-features statement for a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
numThreadsPerSearch
This rule consumes a num-threads-per-search statement for a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
minHitsPerThread
This rule consumes a min-hits-per-thread statement for a rank profile.- Parameters:
profile- The rank profile to modify.- Throws:
ParseException
-
numSearchPartitions
This rule consumes a num-search-partitions statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
termwiseLimit
This rule consumes a termwise-limit statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
postFilterThreshold
This rule consumes a post-filter-threshold statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
approximateThreshold
This rule consumes an approximate-threshold statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
filterFirstThreshold
This rule consumes a filter-first-threshold statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
filterFirstExploration
This rule consumes a filter-first-exploration statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
explorationSlack
This rule consumes an exploration-slack statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
targetHitsMaxAdjustmentFactor
This rule consumes a target-hits-max-adjustment-factor statement for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
rankProperties
Consumes a rank-properties block of a rank profile. There is a little trick within this rule to allow the final rank property to skip the terminating newline token.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
rankProperty
Consumes a single rank property pair for a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
rankPropertyItem
Consumes a single rank property for a rank-properties block.- Returns:
- the token image of the consumed item
- Throws:
ParseException
-
fieldWeight
Consumes a field-weight statement of a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
fieldRankType
Consumes a rank-type statement of a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
fieldRankFilter
Consumes a rank filter statement of a rank profile.- Parameters:
profile- the rank profile to modify- Throws:
ParseException
-
fieldRankItem
- Throws:
ParseException
-
elementGapValue
- Throws:
ParseException
-
constants
Consumes a set of constants available in ranking expressions in the enclosing profile.- Throws:
ParseException
-
constant
- Throws:
ParseException
-
constantName
Returns the reference "constant(name)" for both "constant(name)" and "name".- Throws:
ParseException
-
constantValue
public final void constantValue(ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException - Throws:
ParseException
-
constantTensor
public final void constantTensor(ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException - Throws:
ParseException
-
constantTensorErrorMessage
public final String constantTensorErrorMessage(String rankProfileName, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException - Throws:
ParseException
-
tensorValue
public final com.yahoo.tensor.Tensor tensorValue(com.yahoo.tensor.TensorType type) throws ParseException Parses a tensor written in a tensor literal form, https://docs.vespa.ai/en/reference/tensor.html#tensor-literal-form- Throws:
ParseException
-
mappedTensorValue
A mapped or mixed tensor value.- Throws:
ParseException
-
mappedTensorBlock
- Throws:
ParseException
-
indexedTensorBlockValues
public final void indexedTensorBlockValues(com.yahoo.tensor.TensorAddress mappedAddress, com.yahoo.tensor.Tensor.Builder builder) throws ParseException - Throws:
ParseException
-
indexedTensorValues
public final void indexedTensorValues(com.yahoo.tensor.Tensor.Builder builder) throws ParseException - Throws:
ParseException
-
arrayTensorValues
Tensor array values. Using sub-bracketing for multiple dimensions is optional and therefore ignored here.- Throws:
ParseException
-
indexedTensorValue
- Throws:
ParseException
-
mappedTensorCellValue
public final void mappedTensorCellValue(com.yahoo.tensor.TensorAddress address, com.yahoo.tensor.Tensor.Builder builder) throws ParseException - Throws:
ParseException
-
tensorAddress
public final com.yahoo.tensor.TensorAddress tensorAddress(com.yahoo.tensor.TensorType type) throws ParseException - Throws:
ParseException
-
tensorAddressElement
public final void tensorAddressElement(com.yahoo.tensor.TensorAddress.Builder builder) throws ParseException - Throws:
ParseException
-
tensorAddressLabel
- Throws:
ParseException
-
tensorCellValue
- Throws:
ParseException
-
tensorValuePrefixedByValue
Undocumented syntax for supplying a tensor constant value by a string prefixed by "value"- Throws:
ParseException
-
tensorTypeWithPrefix
public final com.yahoo.tensor.TensorType tensorTypeWithPrefix(String errorMessage) throws ParseException - Throws:
ParseException
-
tensorType
- Throws:
ParseException
-
importField
- Throws:
ParseException
-
expression
This rule consumes an expression token and returns its image.- Returns:
- The consumed token image.
- Throws:
ParseException
-
identifierWithDash
- Throws:
ParseException
-
identifier
Consumes an identifier. This must be kept in sync with all word tokens that should be parseable as identifiers.- Returns:
- the identifier string
- Throws:
ParseException
-
string
Consumes a string token and returns the token image.- Returns:
- The consumed token image.
- Throws:
ParseException
-
quotedString
Consumes a quoted string token and returns the token image minus the quotes. This does not perform unescaping of the content, it simply removes the first and last character of the image. However, the token itself can contain anything but a double quote.- Returns:
- the unquoted token image
- Throws:
ParseException
-
bool
A boolean value.- Throws:
ParseException
-
integer
Consumes an integer token and returns its numeric value.- Throws:
ParseException
-
longValue
Consumes a long or integer token and returns its numeric value.- Throws:
ParseException
-
floatValue
Consumes a floating-point token and returns its numeric value.- Throws:
ParseException
-
number
- Throws:
ParseException
-
lbrace
Consumes an opening brace with leading and trailing newline tokens.- Throws:
ParseException
-
ReInit
Reinitialise.- Parameters:
stream- stream to init with
-
ReInit
Reinitialise- Parameters:
tm- Token manager to use
-
getNextToken
- Returns:
- the next Token.
-
getToken
- Parameters:
index- index to be retrieved- Returns:
- the specific Token.
-
generateParseException
Generate ParseException.- Returns:
- new Exception object. Never
null
-
trace_enabled
public final boolean trace_enabled()- Returns:
- Always
false.
-
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-