riakriak-search

How to make Riak return links from Riak Search


If I do the following, the response header will contain a list of this object's links.

curl -v http://ip:port/riak/tests/aKey

However, if I search for the same object using Riak Search, I get the correct object but without any Riak-specific meta-data in the header (such as links, ETag and Vclock).

curl -v http://ip/riak-search/solr/tests/select?q=tid:%226%22&wt=json

I have an Apache server reverse proxying to Riak, which is why I don't specify the port with Riak Search.

Is there a way to get the links through Riak Search without making a new request?


Solution

  • The link information is stored in Riak KV as metadata in the Riak object, while the data returned by the search is based on the document built by the extractor. You could create a custom extractor that adds the links as an additional field in the search document.

    See http://docs.basho.com/riak/1.3.2/cookbooks/Riak-Search---Indexing-and-Querying-Riak-KV-Data/#Other-Data-Encodings for details on custom extractors.