Package com.basho.riak.client.core.query.search

Examples of com.basho.riak.client.core.query.search.YokozunaSchema


    @Ignore
    @Test
    public void testStoreandFetchSchema() throws InterruptedException, ExecutionException
    {
        Assume.assumeTrue(testYokozuna);
        YokozunaSchema yzSchema = new YokozunaSchema("test_schema",
            "<schema name=\"test_schema\" version=\"1.0\">"
            + "<fields>"
            + "<field name=\"_version_\" type=\"long\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "<field name=\"_yz_id\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\" required=\"true\"/>"
            + "<field name=\"_yz_ed\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "<field name=\"_yz_pn\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "<field name=\"_yz_fpn\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "<field name=\"_yz_vtag\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "<field name=\"_yz_rk\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "<field name=\"_yz_rb\" type=\"_yz_str\" indexed=\"true\" stored=\"true\" multiValued=\"false\"/>"
            + "</fields>"
            + "<uniqueKey>_yz_id</uniqueKey>"
            + "<types>"
            + "<fieldType name=\"_yz_str\" class=\"solr.StrField\" sortMissingLast=\"true\" />"
            + "<fieldType name=\"long\" class=\"solr.TrieLongField\" precisionStep=\"0\" positionIncrementGap=\"0\"/>"
            + "</types>"
            + "</schema>");
       
       
        YzPutSchemaOperation putOp = new YzPutSchemaOperation.Builder(yzSchema).build();
        cluster.execute(putOp);
        putOp.get();
       
        YzGetSchemaOperation getOp =
            new YzGetSchemaOperation.Builder("test_schema").build();
       
        cluster.execute(getOp);
        YokozunaSchema yzSchema2 = getOp.get().getSchema();
       
        assertEquals(yzSchema.getContent(), yzSchema2.getContent());
       
       
    }
View Full Code Here


        Assume.assumeTrue(testYokozuna);
        YzGetSchemaOperation getOp =
            new YzGetSchemaOperation.Builder("_yz_default").build();
       
        cluster.execute(getOp);
        YokozunaSchema yzSchema = getOp.get().getSchema();
       
        assertNotNull(yzSchema.getName());
        assertNotNull(yzSchema.getContent());
       
        YzPutSchemaOperation putOp = new YzPutSchemaOperation.Builder(yzSchema).build();
        cluster.execute(putOp);
        putOp.get();
       
View Full Code Here

    protected YzGetSchemaOperation.Response convert(List<RiakYokozunaPB.RpbYokozunaSchemaGetResp> rawResponse)
    {
        // This isn't a streaming op, so there's only one protobuf in the list
        RiakYokozunaPB.RpbYokozunaSchemaGetResp response = rawResponse.get(0);
       
        return new Response(new YokozunaSchema(response.getSchema().getName().toStringUtf8(),
                                    response.getSchema().getContent().toStringUtf8()));
       
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.core.query.search.YokozunaSchema

Copyright © 2018 www.massapicom. 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.