Search in sources :

Example 71 with Field

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

the class JsonWriterTestCase method registerSetDocumentType.

private void registerSetDocumentType() {
    DocumentType x = new DocumentType("testset");
    DataType d = new WeightedSetDataType(DataType.STRING, true, true);
    x.addField(new Field("actualset", d));
    types.registerDocumentType(x);
}
Also used : Field(com.yahoo.document.Field) WeightedSetDataType(com.yahoo.document.WeightedSetDataType) DocumentType(com.yahoo.document.DocumentType) DataType(com.yahoo.document.DataType) ArrayDataType(com.yahoo.document.ArrayDataType) StructDataType(com.yahoo.document.StructDataType) MapDataType(com.yahoo.document.MapDataType) PositionDataType(com.yahoo.document.PositionDataType) TensorDataType(com.yahoo.document.TensorDataType) WeightedSetDataType(com.yahoo.document.WeightedSetDataType) ReferenceDataType(com.yahoo.document.ReferenceDataType)

Example 72 with Field

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

the class JsonWriterTestCase method registerReferenceDocumentType.

private void registerReferenceDocumentType() {
    DocumentType docTypeWithRef = new DocumentType("testrefs");
    ReferenceDataType type = ReferenceDataType.createWithInferredId(types.getDocumentType("smoke"));
    docTypeWithRef.addField(new Field("ref_field", type));
    types.registerDocumentType(docTypeWithRef);
}
Also used : Field(com.yahoo.document.Field) ReferenceDataType(com.yahoo.document.ReferenceDataType) DocumentType(com.yahoo.document.DocumentType)

Example 73 with Field

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

the class JsonWriterTestCase method registerMirrorsDocumentType.

private void registerMirrorsDocumentType() {
    DocumentType x = new DocumentType("mirrors");
    StructDataType woo = new StructDataType("woo");
    woo.addField(new Field("sandra", DataType.STRING));
    woo.addField(new Field("cloud", DataType.STRING));
    x.addField(new Field("skuggsjaa", woo));
    types.registerDocumentType(x);
}
Also used : Field(com.yahoo.document.Field) StructDataType(com.yahoo.document.StructDataType) DocumentType(com.yahoo.document.DocumentType)

Example 74 with Field

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

the class JsonWriterTestCase method registerMapToStringToArrayDocumentType.

private void registerMapToStringToArrayDocumentType() {
    DocumentType x = new DocumentType("testMapStringToArrayOfInt");
    DataType value = new ArrayDataType(DataType.INT);
    DataType d = new MapDataType(DataType.STRING, value);
    x.addField(new Field("actualMapStringToArrayOfInt", d));
    types.registerDocumentType(x);
}
Also used : Field(com.yahoo.document.Field) DocumentType(com.yahoo.document.DocumentType) DataType(com.yahoo.document.DataType) ArrayDataType(com.yahoo.document.ArrayDataType) StructDataType(com.yahoo.document.StructDataType) MapDataType(com.yahoo.document.MapDataType) PositionDataType(com.yahoo.document.PositionDataType) TensorDataType(com.yahoo.document.TensorDataType) WeightedSetDataType(com.yahoo.document.WeightedSetDataType) ReferenceDataType(com.yahoo.document.ReferenceDataType) MapDataType(com.yahoo.document.MapDataType) ArrayDataType(com.yahoo.document.ArrayDataType)

Example 75 with Field

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

the class JsonWriterTestCase method registerMultiPositionDocumentType.

private void registerMultiPositionDocumentType() {
    DocumentType x = new DocumentType("testmultipos");
    DataType d = new ArrayDataType(PositionDataType.INSTANCE);
    x.addField(new Field("multipos", d));
    types.registerDocumentType(x);
}
Also used : Field(com.yahoo.document.Field) DocumentType(com.yahoo.document.DocumentType) DataType(com.yahoo.document.DataType) ArrayDataType(com.yahoo.document.ArrayDataType) StructDataType(com.yahoo.document.StructDataType) MapDataType(com.yahoo.document.MapDataType) PositionDataType(com.yahoo.document.PositionDataType) TensorDataType(com.yahoo.document.TensorDataType) WeightedSetDataType(com.yahoo.document.WeightedSetDataType) ReferenceDataType(com.yahoo.document.ReferenceDataType) ArrayDataType(com.yahoo.document.ArrayDataType)

Aggregations

Field (com.yahoo.document.Field)115 Test (org.junit.Test)50 StructDataType (com.yahoo.document.StructDataType)46 DocumentType (com.yahoo.document.DocumentType)24 DataType (com.yahoo.document.DataType)17 SimpleTestAdapter (com.yahoo.vespa.indexinglanguage.SimpleTestAdapter)14 ReferenceDataType (com.yahoo.document.ReferenceDataType)13 StringFieldValue (com.yahoo.document.datatypes.StringFieldValue)13 ArrayDataType (com.yahoo.document.ArrayDataType)12 MapDataType (com.yahoo.document.MapDataType)12 TensorDataType (com.yahoo.document.TensorDataType)11 WeightedSetDataType (com.yahoo.document.WeightedSetDataType)11 SDField (com.yahoo.searchdefinition.document.SDField)10 PositionDataType (com.yahoo.document.PositionDataType)9 FieldValue (com.yahoo.document.datatypes.FieldValue)9 IntegerFieldValue (com.yahoo.document.datatypes.IntegerFieldValue)9 GrowableByteBuffer (com.yahoo.io.GrowableByteBuffer)8 Struct (com.yahoo.document.datatypes.Struct)7 DocumentTypeManager (com.yahoo.document.DocumentTypeManager)6 Document (com.yahoo.document.Document)5