How to index existing not-indexed data in riak search?

292 views Asked by At

I am using Riak Search. At some point, I removed the index from the bucket. After having added some new objects into the bucket, I put the index back on.

When I search by the index, I can't find the objects which were not indexed.

How can I index them now? I think that the solution would be also suitable for other not-indexed legacy buckets as well.

1

There are 1 answers

0
canislupax On

My solution for that and some similar problems with searchindices on Bucket-Types i use the following procedures (only in development) have no exp. in production with riak now so someone else has to answer that:

  1. delete the searchindex

    riakc_pb_socket:delete_search_index(Pid, <<"XXX">>, []).

  2. Reindex with creation of a new index (in this case with default values applied)

    riakc_pb_socket:create_search_index(Pid, <<"XXX">>, <<"_yz_default">>, []).

after that your index should be updated and you don`t have to change your code anyway....

happy coding with erlang and riak

Canislupax