RiakSearch with java-client

Santi Kumar santi at veradocs.com
Mon Dec 15 05:08:03 EST 2014


Hi
I'm tying to use Riak Search 2.0 with java client. Couldn't find any good
documentation around that so I'm trying on my own. I've created my own
custom schema and want to setup this to my index. While executing the
StoreSchema command, was getting below error with some message bits.

com.basho.riak.client.core.netty.RiakResponseException: Error processing
incoming message: error:function_clause:xxxxxxx


Here is how I'm adding the Custom schema and adding index. Let me know If
I'm doing something wrong

public static void buildSearchIndex(String bucketName,String indexName)
throws Exception{

    InputStream systemResourceAsStream =
ClassLoader.getSystemResourceAsStream("./veradocs-solr-schema.xml");

    String schema = IOUtils.toString(systemResourceAsStream,"UTF-8");

    RiakClient client = RiakClientUtil.getClient();

    YokozunaSchema yschema = new YokozunaSchema("veradocs-rs", schema);

    StoreSchema storeSchemaOp = new StoreSchema.Builder(yschema).build();

    client.execute(storeSchemaOp);

    YokozunaIndex vdIndex = new YokozunaIndex(indexName,schema);

    StoreIndex storeIndex =

        new StoreIndex.Builder(vdIndex).build();

    client.execute(storeIndex);

    Namespace catsBucket = new Namespace(bucketName);

    StoreBucketProperties storeBucketProps = new
StoreBucketProperties.Builder(catsBucket)

     .withSearchIndex(indexName)

     .build();

    RiakFuture<Void,Namespace> executeAsync = client.executeAsync(
storeBucketProps);

    executeAsync.get();

    }
Thanks
Santi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20141215/a908fb0d/attachment.html>


More information about the riak-users mailing list