Search in sources :

Example 61 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class ToArrayExpression method doExecute.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void doExecute(ExecutionContext ctx) {
    FieldValue input = ctx.getValue();
    DataType inputType = input.getDataType();
    ArrayDataType outputType = DataType.getArray(inputType);
    Array output = outputType.createFieldValue();
    output.add(input);
    ctx.setValue(output);
}
Also used : Array(com.yahoo.document.datatypes.Array) DataType(com.yahoo.document.DataType) ArrayDataType(com.yahoo.document.ArrayDataType) FieldValue(com.yahoo.document.datatypes.FieldValue) ArrayDataType(com.yahoo.document.ArrayDataType)

Example 62 with DataType

use of com.yahoo.document.DataType in project vespa by vespa-engine.

the class ToWsetExpression method doExecute.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void doExecute(ExecutionContext ctx) {
    FieldValue input = ctx.getValue();
    DataType inputType = input.getDataType();
    WeightedSetDataType outputType = DataType.getWeightedSet(inputType, createIfNonExistent, removeIfZero);
    WeightedSet output = outputType.createFieldValue();
    output.add(input);
    ctx.setValue(output);
}
Also used : WeightedSetDataType(com.yahoo.document.WeightedSetDataType) WeightedSetDataType(com.yahoo.document.WeightedSetDataType) DataType(com.yahoo.document.DataType) FieldValue(com.yahoo.document.datatypes.FieldValue) WeightedSet(com.yahoo.document.datatypes.WeightedSet)

Aggregations

DataType (com.yahoo.document.DataType)62 ArrayDataType (com.yahoo.document.ArrayDataType)20 MapDataType (com.yahoo.document.MapDataType)19 Field (com.yahoo.document.Field)17 StructDataType (com.yahoo.document.StructDataType)17 WeightedSetDataType (com.yahoo.document.WeightedSetDataType)17 ReferenceDataType (com.yahoo.document.ReferenceDataType)13 PositionDataType (com.yahoo.document.PositionDataType)12 CollectionDataType (com.yahoo.document.CollectionDataType)11 FieldValue (com.yahoo.document.datatypes.FieldValue)11 TensorDataType (com.yahoo.document.TensorDataType)10 DocumentType (com.yahoo.document.DocumentType)9 StructuredDataType (com.yahoo.document.StructuredDataType)7 CollectionFieldValue (com.yahoo.document.datatypes.CollectionFieldValue)6 SDField (com.yahoo.searchdefinition.document.SDField)6 MapFieldValue (com.yahoo.document.datatypes.MapFieldValue)5 TemporaryStructuredDataType (com.yahoo.document.TemporaryStructuredDataType)4 AnnotationReferenceDataType (com.yahoo.document.annotation.AnnotationReferenceDataType)4 IntegerFieldValue (com.yahoo.document.datatypes.IntegerFieldValue)4 StringFieldValue (com.yahoo.document.datatypes.StringFieldValue)4