Search in sources :

Example 81 with DocumentType

use of com.yahoo.document.DocumentType 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 82 with DocumentType

use of com.yahoo.document.DocumentType 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 83 with DocumentType

use of com.yahoo.document.DocumentType 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 84 with DocumentType

use of com.yahoo.document.DocumentType 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)

Example 85 with DocumentType

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

the class JsonWriterTestCase method registerSinglePositionDocumentType.

private void registerSinglePositionDocumentType() {
    DocumentType x = new DocumentType("testsinglepos");
    DataType d = PositionDataType.INSTANCE;
    x.addField(new Field("singlepos", 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)

Aggregations

DocumentType (com.yahoo.document.DocumentType)98 Test (org.junit.Test)45 Document (com.yahoo.document.Document)41 DocumentPut (com.yahoo.document.DocumentPut)35 Field (com.yahoo.document.Field)24 StringFieldValue (com.yahoo.document.datatypes.StringFieldValue)24 DocumentId (com.yahoo.document.DocumentId)20 ByteArrayInputStream (java.io.ByteArrayInputStream)19 InputStream (java.io.InputStream)19 DocumentTypeManager (com.yahoo.document.DocumentTypeManager)17 DocumentParseInfo (com.yahoo.document.json.readers.DocumentParseInfo)17 VespaJsonDocumentReader (com.yahoo.document.json.readers.VespaJsonDocumentReader)17 DocumentUpdate (com.yahoo.document.DocumentUpdate)15 IntegerFieldValue (com.yahoo.document.datatypes.IntegerFieldValue)15 StructDataType (com.yahoo.document.StructDataType)14 TensorDataType (com.yahoo.document.TensorDataType)12 TensorFieldValue (com.yahoo.document.datatypes.TensorFieldValue)11 ArrayDataType (com.yahoo.document.ArrayDataType)10 MapDataType (com.yahoo.document.MapDataType)10 ReferenceDataType (com.yahoo.document.ReferenceDataType)10