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
Modifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface com.yahoo.schema.parser.SchemaParserConstants
ALIAS, 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, ENABLE_BIT_VECTORS, ENABLE_BM25, ENABLE_ONLY_BIT_VECTOR, EOF, EVALUATION_POINT, EXACT, EXACT_TERMINATOR, EXECUTION_MODE, EXPRESSION_ML, EXPRESSION_SL, FALSE, FAST_ACCESS, FAST_RANK, FAST_SEARCH, FIELD, FIELDS, FIELDSET, FILE, FILE_PATH, FILTER, FIRST_PHASE, 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, INHERITS, INLINE, INPUTS, INTEGER, INTEROP_THREADS, INTRAOP_THREADS, KEEP_RANK_COUNT, LBRACE, LESSTHAN, LITERAL, LOCALE, LONG, 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, 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, SEQUENTIAL, SINGLE_LINE_COMMENT, SINGLEQUOTEDSTRING, SORTING, SOURCE, SSCONTEXTUAL, SSOVERRIDE, SSTITLE, SSURL, STATIC, STEMMING, STRENGTH, STRICT, STRING, 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, TRUE, TYPE, UCA, UNCASED, UPPER_BOUND, URI, URI_PATH, VARIABLE, WEIGHT, WEIGHTEDSET, WORD
-
Constructor Summary
ConstructorDescriptionSchemaParser
(CharStream stream) Constructor with user supplied CharStream.Constructor with generated Token Manager.SchemaParser
(SimpleCharStream stream, com.yahoo.config.application.api.DeployLogger deployLogger, com.yahoo.config.model.api.ModelContext.Properties properties) Creates a parser. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
alias
(com.yahoo.schema.parser.ParsedField field) final void
annotation
(ParsedDocument document) Consumes an annotation block from within a document elementfinal void
annotationBody
(com.yahoo.schema.parser.ParsedAnnotation type) Consumes a single element of an annotation body block.final void
annotationOutside
(ParsedSchema schema) This rule consumes a annotation block from within a schema element.final com.yahoo.schema.parser.ParsedType
final void
approximateThreshold
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes an approximate-threshold statement for a rank profile.final void
arrayTensorValues
(List<Double> values) Tensor array values.final void
attribute
(com.yahoo.schema.parser.ParsedField field) This rule consumes an attribute statement of a field element.final void
attributeSetting
(com.yahoo.schema.parser.ParsedAttribute attribute) This rule consumes a single attribute setting statement of an attribute element.final void
attributeSorting
(com.yahoo.schema.parser.ParsedAttribute attribute) final void
bolding
(com.yahoo.schema.parser.ParsedField field) This rule consumes a bolding statement of a field element.final Boolean
bool()
A boolean value.final void
constant
(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) final com.yahoo.searchlib.rankingexpression.Reference
Returns the reference "constant(name)" for both "constant(name)" and "name".final void
constants
(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a set of constants available in ranking expressions in the enclosing profile.final void
constantTensor
(com.yahoo.schema.parser.ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) final String
constantTensorErrorMessage
(String rankProfileName, com.yahoo.searchlib.rankingexpression.Reference name) final void
constantValue
(com.yahoo.schema.parser.ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) final com.yahoo.schema.parser.ParsedType
dataType()
This rule consumes a data type block from within a field element.final void
dictionary
(com.yahoo.schema.parser.ParsedField field) This rule consumes a dictionary statement of a field element.final void
dictionarySetting
(com.yahoo.schema.parser.ParsedField field) final void
Disable tracing.final void
diversity
(RankProfile.MatchPhaseSettings profile) This rule consumes a diversity block of a rank profile.final void
diversityItem
(RankProfile.DiversitySettings settings) final void
document
(ParsedSchema schema) Consumes a document element.final void
documentBody
(ParsedDocument document) Consumes a document body blockfinal void
documentSummary
(ParsedSchema schema) Consumes a document-summary block from within a schema block.final void
documentSummaryItem
(com.yahoo.schema.parser.ParsedDocumentSummary summary) Consumes a single document-summary item.final void
Enable tracing.final void
exactTerminator
(ParsedMatchSettings matchInfo) final String
This rule consumes an expression token and returns its image.final com.yahoo.schema.parser.ParsedField
field()
Consumes a field blockfinal void
fieldBody
(com.yahoo.schema.parser.ParsedField field) This rule consumes a single element of a field body block.final void
fieldInsideDoc
(ParsedDocument document) Consumes a field block from within a document element.final void
fieldOutsideDoc
(ParsedSchema schema) Consumes a field block from outside a document element.final void
fieldRankFilter
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a rank filter statement of a rank profile.final void
fieldRankType
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a rank-type statement of a rank profile.final void
fieldSet
(ParsedSchema schema) Consumes a fieldset blockfinal void
fieldSorting
(com.yahoo.schema.parser.ParsedField field) final void
fieldStemming
(com.yahoo.schema.parser.ParsedField field) This rule consumes a stemming block of a field element.final void
fieldWeight
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a field-weight statement of a rank profile.final String
fileItem()
final void
firstPhase
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes the first-phase block of a rank profile.final void
firstPhaseItem
(com.yahoo.schema.parser.ParsedRankProfile profile) final double
Consumes a floating-point token and returns its numeric value.final void
function
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a function statement of a rank-profile.Generate ParseException.final Token
final Token
getToken
(int index) final void
globalPhase
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes the global-phase block of a rank profile.final void
globalPhaseItem
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a statement for a global-phase block.final void
gramSize
(ParsedMatchSettings matchInfo) final void
hnswIndex
(com.yahoo.schema.parser.ParsedIndex index) final void
hnswIndexBody
(HnswIndexParams.Builder params) final void
id
(com.yahoo.schema.parser.ParsedField field) Consumes an id statement of a field body block.final String
Consumes an identifier.final String
final void
ignoreRankFeatures
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a ignore-default-rank-features statement for a rank profile.final void
importField
(ParsedSchema schema) final void
indexBody
(com.yahoo.schema.parser.ParsedIndex index) Consumes a single index statement for an index block.final void
indexedTensorBlockValues
(com.yahoo.tensor.TensorAddress mappedAddress, com.yahoo.tensor.Tensor.Builder builder) final void
indexedTensorValue
(List<Double> values) final void
indexedTensorValues
(com.yahoo.tensor.Tensor.Builder builder) final void
indexing
(com.yahoo.schema.parser.ParsedField field) This rule consumes an indexing block of a field element.final void
indexingOperation
(com.yahoo.schema.parser.ParsedField field, boolean multiLine) This rule consumes an IL script block.final void
indexInsideField
(com.yahoo.schema.parser.ParsedField field) Consumes an index block for a field element.final void
indexOutsideDoc
(ParsedSchema schema) Consumes an index block in a schema element.final void
inheritsAnnotation
(com.yahoo.schema.parser.ParsedAnnotation annotation) final void
inheritsDocument
(ParsedDocument document) Consumes a document inheritance statement.final void
inheritsDocumentSummary
(com.yahoo.schema.parser.ParsedDocumentSummary documentSummary) This rule consumes an inherits statement of a document summary.final void
inheritsRankProfile
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes an inherits statement of a rank-profile.final void
inheritsStruct
(ParsedStruct struct) Consumes struct inheritancefinal boolean
inline()
final void
input
(com.yahoo.schema.parser.ParsedRankProfile profile) final com.yahoo.searchlib.rankingexpression.Reference
Returns the reference "query(name)" for both "query(name)" and "name".final void
inputs
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes an inputs block of a rank profile.final int
integer()
Consumes an integer token and returns its numeric value.final void
lbrace()
Consumes an opening brace with leading and trailing newline tokens.final long
Consumes a long or integer token and returns its numeric value.final com.yahoo.schema.parser.ParsedType
final void
mappedTensorBlock
(com.yahoo.tensor.Tensor.Builder builder) final void
mappedTensorCellValue
(com.yahoo.tensor.TensorAddress address, com.yahoo.tensor.Tensor.Builder builder) final void
mappedTensorValue
(com.yahoo.tensor.Tensor.Builder builder) A mapped or mixed tensor value.final void
matchFeatures
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a match-features block of a rank profile.final void
matchItem
(ParsedMatchSettings matchInfo) This rule consumes a single match item for a match block.final void
matchPhase
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a match-phase block of a rank profile.final void
matchPhaseItem
(RankProfile.MatchPhaseSettings settings) final void
matchSettings
(ParsedMatchSettings matchInfo) final void
matchSize
(ParsedMatchSettings matchInfo) final void
matchType
(ParsedMatchSettings matchInfo) final void
minHitsPerThread
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a min-hits-per-thread statement for a rank profile.final void
mutate
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes an mutate statement of a rank-profile.final String
final void
mutate_operation
(com.yahoo.schema.parser.ParsedRankProfile profile) final ParsedDocument
Consumes a document element, explicitly namedfinal void
normalizing
(com.yahoo.schema.parser.ParsedField field) This rule consumes a normalizing statement of a field element.final Number
number()
final void
numSearchPartitions
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a num-search-partitions statement for a rank profile.final void
numThreadsPerSearch
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a num-threads-per-search statement for a rank profile.final OnnxModel
Consumes an onnx-model block.final void
onnxModelInProfile
(com.yahoo.schema.parser.ParsedRankProfile profile) final void
onnxModelInSchema
(ParsedSchema schema) final void
onnxModelItem
(OnnxModel onnxModel) Consumes an onnx-model block.final void
postFilterThreshold
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a post-filter-threshold statement for a rank profile.final void
queryCommand
(com.yahoo.schema.parser.ParsedField field) final String
Consumes a quoted string token and returns the token image minus the quotes.final void
rank
(com.yahoo.schema.parser.ParsedField field) Consumes a rank statement of a field element.final void
rankFeatures
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a rank-features block of a rank profilefinal void
rankingConstant
(ParsedSchema schema) Consumes a constant block of a schema element.final String
final void
rankProfile
(ParsedSchema schema) Consumes a rank-profile block of a schema element.final void
rankProfileItem
(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a single statement for a rank-profile block.final void
rankProperties
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a rank-properties block of a rank profile.final void
rankProperty
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a single rank property pair for a rank profile.final String
Consumes a single rank property for a rank-properties block.final void
rankSetting
(com.yahoo.schema.parser.ParsedField field) Consumes a single rank setting of a rank statement.final void
rankType
(com.yahoo.schema.parser.ParsedField field) This rule consumes a rank-type statement of a field element.final void
rawAsBase64
(ParsedSchema schema) final com.yahoo.schema.parser.ParsedType
void
ReInit
(CharStream stream) Reinitialise.void
Reinitialisefinal ParsedSchema
Consumes a schema definition that contains only documents to be used for inheritance, etc.final ParsedSchema
rootDocumentItem
(ParsedSchema schema) Consumes a single item from within a root document node.final ParsedSchema
This rule consumes a proper schema block.final void
rootSchemaItem
(ParsedSchema schema) Consumes an element of a schema block.final ParsedSchema
schema()
The rule consumes any schema and returns the corresponding object.final void
searchStemming
(ParsedSchema schema) This rule consumes a stemming statement for a schema element.final void
secondPhase
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes the second-phase block of a rank profile.final void
secondPhaseItem
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a statement for a second-phase block.final void
sorting
(com.yahoo.schema.parser.ParsedSorting sort) final void
sortingSetting
(com.yahoo.schema.parser.ParsedSorting sorting) final void
strict
(com.yahoo.schema.parser.ParsedRankProfile profile) final String
string()
Consumes a string token and returns the token image.final ParsedStruct
This rule consumes a struct declaration blockfinal void
structField
(com.yahoo.schema.parser.ParsedField field) This rule consumes a struct subfield from a document field body.final void
structFieldBody
(com.yahoo.schema.parser.ParsedField field) This rule consumes a single element of a struct subfield body block.final void
structFieldDefinition
(ParsedStruct struct) This rule consumes a field block of a struct body.final void
structInside
(ParsedDocument document) This rule consumes a struct block from within a document element.final void
structOutside
(ParsedSchema schema) This rule consumes a struct block from within a schema element.final void
summaryBolding
(com.yahoo.schema.parser.ParsedSummaryField field) This rule consumes a bolding statement for a summary field element.final void
summaryDestinationList
(com.yahoo.schema.parser.ParsedSummaryField field) This rule consumes a destination-list statement for a summary field element.final void
summaryFeatures
(com.yahoo.schema.parser.ParsedRankProfile profile) Consumes a summary-features block of a rank profile.final void
summaryInDocument
(com.yahoo.schema.parser.ParsedDocumentSummary docsum) This rule consumes a summary statement defined inside a document-summary block.final void
summaryInField
(com.yahoo.schema.parser.ParsedField field) The rule consumes a summary statement defined inside a field.final void
summaryInFieldLong
(com.yahoo.schema.parser.ParsedField field) This rule consumes a multi-line summary field.final void
summaryInFieldShort
(com.yahoo.schema.parser.ParsedField field) This rule consumes a single-line summary field.final void
summaryItem
(com.yahoo.schema.parser.ParsedSummaryField field) This rule consumes an item of a summary field block.final void
summarySourceList
(com.yahoo.schema.parser.ParsedSummaryField field) This rule consumes a source-list statement for a summary field element.final void
summaryTo
(com.yahoo.schema.parser.ParsedField field) This rule consumes a summary-to statement of a field element.final void
summaryTransform
(com.yahoo.schema.parser.ParsedSummaryField field) This rule consumes a transform statement for a summary field element.final void
targetHitsMaxAdjustmentFactor
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a target-hits-max-adjustment-factor statement for a rank profile.final com.yahoo.tensor.TensorAddress
tensorAddress
(com.yahoo.tensor.TensorType type) final void
tensorAddressElement
(com.yahoo.tensor.TensorAddress.Builder builder) final String
final double
final com.yahoo.tensor.TensorType
tensorType
(String errorMessage) final com.yahoo.tensor.TensorType
tensorTypeWithPrefix
(String errorMessage) final com.yahoo.tensor.Tensor
tensorValue
(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 String
Undocumented syntax for supplying a tensor constant value by a string prefixed by "value"final void
termwiseLimit
(com.yahoo.schema.parser.ParsedRankProfile profile) This rule consumes a termwise-limit statement for a rank profile.final boolean
final String
uriItem()
final com.yahoo.tensor.TensorType
valueType
(com.yahoo.searchlib.rankingexpression.Reference reference) final void
weight
(com.yahoo.schema.parser.ParsedField field) This rule consumes a weight statement of a field element.final void
weightedset
(com.yahoo.schema.parser.ParsedType fieldType) This rule consumes a weighted set statement of a field element.final void
weightedsetBody
(com.yahoo.schema.parser.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, com.yahoo.config.model.api.ModelContext.Properties properties) 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
public final void annotationBody(com.yahoo.schema.parser.ParsedAnnotation type) throws ParseException Consumes a single element of an annotation body block.- Throws:
ParseException
-
inheritsAnnotation
public final void inheritsAnnotation(com.yahoo.schema.parser.ParsedAnnotation annotation) throws ParseException - 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
public final void indexingOperation(com.yahoo.schema.parser.ParsedField field, boolean multiLine) throws ParseException 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
public final void attributeSorting(com.yahoo.schema.parser.ParsedAttribute attribute) throws ParseException - Throws:
ParseException
-
sorting
- Throws:
ParseException
-
sortingSetting
public final void sortingSetting(com.yahoo.schema.parser.ParsedSorting sorting) throws ParseException - Throws:
ParseException
-
attributeSetting
public final void attributeSetting(com.yahoo.schema.parser.ParsedAttribute attribute) throws ParseException This rule consumes a single attribute setting statement of an attribute element.- Parameters:
attribute
- The attribute to change.- Throws:
ParseException
-
summaryInDocument
public final void summaryInDocument(com.yahoo.schema.parser.ParsedDocumentSummary docsum) throws ParseException 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
public final void summaryInFieldShort(com.yahoo.schema.parser.ParsedField field) throws ParseException This rule consumes a single-line summary field.- Throws:
ParseException
-
summaryInFieldLong
public final void summaryInFieldLong(com.yahoo.schema.parser.ParsedField field) throws ParseException This rule consumes a multi-line summary field.- Throws:
ParseException
-
summaryItem
public final void summaryItem(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException This rule consumes an item of a summary field block.- Parameters:
field
- The field to modify.- Throws:
ParseException
-
summaryTransform
public final void summaryTransform(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException This rule consumes a transform statement for a summary field element.- Parameters:
field
- The field to modify.- Throws:
ParseException
-
summaryBolding
public final void summaryBolding(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException This rule consumes a bolding statement for a summary field element.- Parameters:
field
- The summary field to modify.- Throws:
ParseException
-
summarySourceList
public final void summarySourceList(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException This rule consumes a source-list statement for a summary field element.- Parameters:
field
- The summary field to modify.- Throws:
ParseException
-
summaryDestinationList
public final void summaryDestinationList(com.yahoo.schema.parser.ParsedSummaryField field) throws ParseException 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
public final void dictionarySetting(com.yahoo.schema.parser.ParsedField field) throws ParseException - 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
-
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(com.yahoo.schema.parser.ParsedDocumentSummary documentSummary) throws ParseException This rule consumes an inherits statement of a document summary.- Parameters:
documentSummary
- the document summary to modify- Throws:
ParseException
-
documentSummaryItem
public final void documentSummaryItem(com.yahoo.schema.parser.ParsedDocumentSummary summary) throws ParseException 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
public final void onnxModelInProfile(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException - 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, com.yahoo.schema.parser.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
public final void inheritsRankProfile(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException 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
public final void mutate_operation(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException - 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
public final void matchPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a match-phase block of a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
matchPhaseItem
- Throws:
ParseException
-
diversity
This rule consumes a diversity block of a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
diversityItem
- Throws:
ParseException
-
firstPhase
public final void firstPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes the first-phase block of a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
firstPhaseItem
public final void firstPhaseItem(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException - Throws:
ParseException
-
secondPhase
public final void secondPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes the second-phase block of a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
secondPhaseItem
public final void secondPhaseItem(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a statement for a second-phase block.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
globalPhase
public final void globalPhase(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes the global-phase block of a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
globalPhaseItem
public final void globalPhaseItem(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException 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
- Throws:
ParseException
-
inputName
Returns the reference "query(name)" for both "query(name)" and "name".- Throws:
ParseException
-
valueType
public final com.yahoo.tensor.TensorType valueType(com.yahoo.searchlib.rankingexpression.Reference reference) throws ParseException - Throws:
ParseException
-
summaryFeatures
public final void summaryFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a summary-features block of a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
strict
- Throws:
ParseException
-
matchFeatures
public final void matchFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a match-features block of a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
rankFeatures
public final void rankFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a rank-features block of a rank profile- Throws:
ParseException
-
ignoreRankFeatures
public final void ignoreRankFeatures(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a ignore-default-rank-features statement for a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
numThreadsPerSearch
public final void numThreadsPerSearch(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a num-threads-per-search statement for a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
minHitsPerThread
public final void minHitsPerThread(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a min-hits-per-thread statement for a rank profile.- Parameters:
profile
- The rank profile to modify.- Throws:
ParseException
-
numSearchPartitions
public final void numSearchPartitions(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a num-search-partitions statement for a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
termwiseLimit
public final void termwiseLimit(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a termwise-limit statement for a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
postFilterThreshold
public final void postFilterThreshold(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a post-filter-threshold statement for a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
approximateThreshold
public final void approximateThreshold(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes an approximate-threshold statement for a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
targetHitsMaxAdjustmentFactor
public final void targetHitsMaxAdjustmentFactor(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException This rule consumes a target-hits-max-adjustment-factor statement for a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
rankProperties
public final void rankProperties(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException 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
public final void rankProperty(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException 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
public final void fieldWeight(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a field-weight statement of a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
fieldRankType
public final void fieldRankType(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a rank-type statement of a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
fieldRankFilter
public final void fieldRankFilter(com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a rank filter statement of a rank profile.- Parameters:
profile
- the rank profile to modify- Throws:
ParseException
-
constants
public final void constants(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException Consumes a set of constants available in ranking expressions in the enclosing profile.- Throws:
ParseException
-
constant
public final void constant(ParsedSchema schema, com.yahoo.schema.parser.ParsedRankProfile profile) throws ParseException - Throws:
ParseException
-
constantName
Returns the reference "constant(name)" for both "constant(name)" and "name".- Throws:
ParseException
-
constantValue
public final void constantValue(com.yahoo.schema.parser.ParsedRankProfile profile, com.yahoo.searchlib.rankingexpression.Reference name) throws ParseException - Throws:
ParseException
-
constantTensor
public final void constantTensor(com.yahoo.schema.parser.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.
-