Riak Search Issue

Alex De la rosa alex.rosa.box at gmail.com
Mon Aug 18 10:50:16 EDT 2014


Hi Luke,

I also tried with a normal bucket "cats" using the type "animals" as the
documentation seemed to suggest and gave me the same error but this time
saying that "cats" was not found as an index... so... still no clue how to
do it.

This is an alternate code I did looking at the Python client API
documentation, etc...

client.create_search_index('men')
bucket = client.bucket('accounts')
bucket.enable_search()
bucket.set_property('search_index', 'men')
key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
content_type='application/json')
key.store()
print bucket.search('sex=male')

Again, it says "accounts" is not an index... in this code no bucket types
are used, just a plain bucket "accounts"... what is wrong? what is missing
for it to work??

This is really frustrating.

Thanks,
Alex


On Mon, Aug 18, 2014 at 4:44 PM, Luke Bakken <lbakken at basho.com> wrote:

> Hi Alex -
>
> You correctly created the "famous" index, as well as correctly
> associated it with the bucket *type* "animals". Note that a bucket
> type is not the same thing as a bucket in previous versions of Riak. A
> bucket type is a way to give 1 or more buckets within that type the
> same properties. You'll have to use different code in your Riak client
> to use bucket types:
>
> http://docs.basho.com/riak/2.0.0/dev/advanced/bucket-types/
>
> --
> Luke Bakken
> CSE
> lbakken at basho.com
>
>
> On Mon, Aug 18, 2014 at 7:32 AM, Alex De la rosa
> <alex.rosa.box at gmail.com> wrote:
> > If I do this, I got the right index:
> >
> > http://RIAK:8098/search/index/famous
> > => {"name":"famous","n_val":3,"schema":"_yz_default"}
> >
> > If I do this, I get an error:
> > http://RIAK:8098/search/index/animals
> > => not found
> >
> > What I don't understand is why it believes the index is the bucket name
> and
> > not the index I created for it?
> >
> > riak-admin bucket-type create animals
> '{"props":{"search_index":"famous"}}'
> > riak-admin bucket-type activate animals
> >
> > Shouldn't it be looking for a "famous" index instead of an "animals"
> index??
> >
> > Thanks!
> > Alex
> >
> >
> > On Mon, Aug 18, 2014 at 4:26 PM, Luke Bakken <lbakken at basho.com> wrote:
> >>
> >> What is the output of this command? Please replace RIAK_HOST and
> >> "name_of_the_bucket" with the correct information:
> >>
> >> curl "$RIAK_HOST/search/index/name_of_the_bucket"
> >>
> >> If the above returns a 404, please use this guide to ensure you've
> >> created the index correctly:
> >>
> >> http://docs.basho.com/riak/2.0.0/dev/using/search/
> >>
> >> If you expect the index to be there and it is not, the solr.log file
> >> in /var/log/riak could provide a clue.
> >>
> >> --
> >> Luke Bakken
> >> CSE
> >> lbakken at basho.com
> >>
> >>
> >> On Mon, Aug 18, 2014 at 6:59 AM, Alex De la rosa
> >> <alex.rosa.box at gmail.com> wrote:
> >> > Hi there,
> >> >
> >> > I had been following the documentation [
> >> > http://docs.basho.com/riak/2.0.0/dev/using/search/ ] about Riak
> Search
> >> > and
> >> > the code provided in the site doesn't seem to work?
> >> >
> >> > Everything I try ends up with an error saying no index found taking
> the
> >> > name
> >> > of the bucket as a not found index :(
> >> >
> >> > riak.RiakError: 'No index <<"name_of_the_bucket">> found.'
> >> >
> >> > Somebody knows what's going on?
> >> >
> >> > Thanks!
> >> > Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140818/aa78abb8/attachment.html>


More information about the riak-users mailing list