riaksearch: using index docs in place of real objects
mathias at basho.com
Thu May 26 15:33:36 EDT 2011
This behavior is specific to the Solr interface. It first fetches document IDs matching the criteria and then fetches the documents from Riak KV. Using the Erlang interface you can fetch just the IDs. It would certainly make sense to add an option like that, but it'd be inconsistent with Solr's interface.
As far as I know (and I tried to confirm this in the dark depths of the Solr wiki) you can tell Solr to store specifc indexed fields, but not specify an option at query time to omit stored fields. Correct me if I'm wrong though, would be more than reason (and probably also simple) enough to add something like that to the Riak Search Solr API.
Developer Advocate, Basho Technologies
On Donnerstag, 26. Mai 2011 at 20:50, Greg Pascale wrote:
> Thanks Mathias,
> We'll continue to do that then.
> It seems to me, though, that in the common case you aren't interested in the index docs when you do a search, so it's needlessly inefficient to retrieve them. Might it make sense to add a search option to not return the index docs if you don't care about them?
> On Thu, May 26, 2011 at 6:42 AM, Mathias Meyer <mathias at basho.com (mailto:mathias at basho.com)> wrote:
> > Greg,
> > Riak Search stores indexed documents in Riak KV too, as serialized Erlang terms. You can easily verify that by requesting a document from http://riak.host:8098/riak/_rsid_<bucket>/key.
> > So whenever you query something through the Solr interface the documents you get back are fetched from these buckets, and therefore the same distribution and consistency properties apply to them as to objects stored directly in Riak KV. Bottom line is there's nothing wrong with just using them instead of fetching them again from Riak KV.
> > Mathias Meyer
> > Developer Advocate, Basho Technologies
> > On Mittwoch, 25. Mai 2011 at 00:34, Greg Pascale wrote:
> > > Hi,
> > >
> > > In our data model, our riak objects are flat JSON objects, and thus their corresponding index documents are nearly identical - the only difference is that a few fields which are ints in the riak objects are strings in the index doc.
> > >
> > > Since they are so similar, we are directly using the index docs returned from our search call, skipping the second step of doing gets on the returned keys to retrieve the real objects.
> > >
> > > Is this advisable? Are there any circumstances under which we might run into consistency issues?
> > >
> > > Thanks,
> > > -Greg
> > >
> > > _______________________________________________
> > > riak-users mailing list
> > > riak-users at lists.basho.com (mailto:riak-users at lists.basho.com) (mailto:riak-users at lists.basho.com)
> > > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
More information about the riak-users