RiakSearch with java-client

Luke Bakken lbakken at basho.com
Wed Dec 17 11:28:36 EST 2014


Santi,

The code you provided looks correct which is why I'm hoping that you
can get an error message out of a log file.

Another test would be to use HTTP to upload your schema and create the
index. We may get more information that way.

Uploading a schema via HTTP:
http://docs.basho.com/riak/latest/dev/advanced/search-schema/
Creating an index via HTTP:
http://docs.basho.com/riak/latest/dev/using/search/#Simple-Setup
--
Luke Bakken
Engineer / CSE
lbakken at basho.com


On Wed, Dec 17, 2014 at 8:17 AM, Santi Kumar <santi at veradocs.com> wrote:
> Hi Luke,
> Yes I couldn't capture it. Looks like the message that was sent to Riak has
> wrong format, so it's relate to Message. I am not able to recollect now. It
> displayed the complete message.
>
> If you can help me out with the the right way of using the Java Client api
> that would be great. When I use StoreSchema with the schema content as the
> string, this is happening. Is there any elegant way?
>
> Appreciate your help Luke
>
> Thanks
> Santi
>
> On Wed, Dec 17, 2014 at 8:37 PM, Luke Bakken <lbakken at basho.com> wrote:
>>
>> Hi Santi,
>>
>> Do you have any error in your Riak log files? They'll be located in
>> /var/log/riak or dev*/log (if you're using a devrel). In particular,
>> look in the solr.log file.
>> --
>> Luke Bakken
>> Engineer / CSE
>> lbakken at basho.com
>>
>>
>> On Mon, Dec 15, 2014 at 2:08 AM, Santi Kumar <santi at veradocs.com> wrote:
>> > 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
>> >
>> >
>> >
>> > _______________________________________________
>> > riak-users mailing list
>> > riak-users at lists.basho.com
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> >




More information about the riak-users mailing list