Examples of DocumentSchemaBuilder


Examples of com.bluetangstudio.searchcloud.client.utils.DocumentSchemaBuilder

public class DocumentSchemaTest {

    /** Tests the serialization of DocumentSchema from object to string or vice versa. */
    @Test
    public void testSerialization() throws IOException {
        DocumentSchemaBuilder builder = new DocumentSchemaBuilder();
        DocumentSchema schema = builder.withField("string", new StringFieldType(Language.ZH_TW)).withField("date",
            new DateFieldType()).withField("location", new LocationFieldType()).withField("int",
            new IntegerFieldType(true)).withField("double", new DoubleFieldType(true)).build();

        String jsonString = SerializationUtils.toJson(schema);

View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.utils.DocumentSchemaBuilder

public class MapFieldTypeTest {

    /** Tests the serialization of MapFieldType from object to string or vice versa. */
    @Test
    public void testSerialization() throws IOException {
        DocumentSchemaBuilder builder = new DocumentSchemaBuilder();
        DocumentSchema schema = builder.withField("string", new StringFieldType(Language.ZH_TW)).withField("date",
            new DateFieldType()).withField("location", new LocationFieldType()).withField("int",
            new IntegerFieldType(true)).withField("double", new DoubleFieldType(true)).build();

        MapFieldType mapFieldType = new MapFieldType(schema.getFields());

View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.utils.DocumentSchemaBuilder

        RestSearchCloudClient client = new RestSearchCloudClient(new DefaultHttpClientFactory(), getUri(), "apikey");

        String modelId = "test_SetSchema";

        DocumentSchemaBuilder builder = new DocumentSchemaBuilder();
        DocumentSchema schema = builder.withField("string", new StringFieldType(Language.ZH_TW)).withField("date",
                new DateFieldType()).withField("location", new LocationFieldType()).withField("int",
                new IntegerFieldType(true)).withField("double", new DoubleFieldType(true)).build();
       
        client.setSchema(new SetSchemaRequest(modelId, schema));
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.utils.DocumentSchemaBuilder

        String modelId = "test_GetSchema";
        DocumentSchema schema = client.getSchema(new GetSchemaRequest(modelId));

        Assert.assertNotNull(schema);

        DocumentSchemaBuilder builder = new DocumentSchemaBuilder();
        DocumentSchema expectedSchema = builder.withField("string", new StringFieldType(Language.ZH_TW)).withField(
                "date", new DateFieldType()).withField("location", new LocationFieldType()).withField("int",
                new IntegerFieldType(true)).withField("double", new DoubleFieldType(true)).build();

        Assert.assertEquals(schema, expectedSchema);
    }
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.utils.DocumentSchemaBuilder

     */
    @GET
    public DocumentSchema get(@PathParam("modelId") String modelId) {
        Assert.assertNotNull(modelId);

        DocumentSchemaBuilder builder = new DocumentSchemaBuilder();
        DocumentSchema schema = builder.withField("string", new StringFieldType(Language.ZH_TW)).withField("date",
                new DateFieldType()).withField("location", new LocationFieldType()).withField("int",
                new IntegerFieldType(true)).withField("double", new DoubleFieldType(true)).build();

        return schema;
    }
View Full Code Here

Examples of com.bluetangstudio.searchcloud.client.utils.DocumentSchemaBuilder

public class SetSchemaRequestBuilderTest extends RequestBuilderTestBase {

    @Test
    public void buildHttpUriRequest() {

        DocumentSchemaBuilder documentSchemaBuilder = new DocumentSchemaBuilder();
        DocumentSchema schema = documentSchemaBuilder.withField("string", new StringFieldType(Language.ZH_TW))
                .withField("date", new DateFieldType()).withField("location", new LocationFieldType()).withField("int",
                        new IntegerFieldType(true)).withField("double", new DoubleFieldType(true)).build();

        SetSchemaRequest buildSchemaRequest = new SetSchemaRequest("BuildSchemaRequestBuilderTest", schema);
        setTrackingVariables(buildSchemaRequest);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.