Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
15:41 <notbenh> I'm a little confused on links, can an object only have one 'tag' name for a link?
ie tags for a blog post should they by $obj->link('tag', ['one','two'])
or should it be $obj->link('tag','one'); $obj->link('tag','two')
15:41 <notbenh> all the examples have links as flat values
15:42 <notbenh> or rather names
15:43 <notbenh> is what I'm looking
at and hb/first has two tags 'foo' and 'bar' rather then 'foo','foo'
16:02 <technoweenie> that tag value is not for specifying weblog tags or anything like that
16:02 <technoweenie> riaktag is a way to specify what the link relationship means
16:03 <technoweenie> or maybe thats rel
16:03 <technoweenie>
16:03 <technoweenie> Link: </riak/list/1>; riaktag="previous", </riak/list/3>; riaktag="next"
16:05 <technoweenie> you can set custom meta data for your riak objects though
16:05 <technoweenie> X-Riak-Meta-Tag: foo, bar
16:42 <notbenh> technoweenie: thanks for the clarification so a link is a one-to-one only
16:42 <technoweenie> yup, kind of a simple link db
16:42 <bingeldac> and uni-directional
16:42 <technoweenie> ah yes that's the really important part... i read 'one to one' wrong
16:43 <notbenh> I guess the problem was that I was thinking more that it was a named fkey
16:43 <bingeldac> you can link them reciprocally though
16:43 <notbenh> bingeldac: thanks that helps
16:44 <technoweenie> sure, you can link a blog post to an author, but you probably wont want to
link the author to every blog post they wrote
16:44 <notbenh> bingeldac: so obj1 => obj2 and obj2 => obj1
16:44 <notbenh> technoweenie: ya I was more thinking the author => [post1, post2] but it looks
like I could just go the other way and do post1 => author and post2 => author
16:44 <bingeldac> yep
16:45 <technoweenie> right but you cant really query what posts an author wrote
16:45 <bingeldac> gotta run
16:45 <notbenh> bingeldac: thanks for the help
16:45 <notbenh> technoweenie: so if I really needed to keep a list of posts by author that should
be it's own doc
16:45 <technoweenie> yes
16:45 <notbenh> technoweenie: check
16:45 <technoweenie> or you can look into riak search
16:46 <notbenh> technoweenie: well riak search is why I finally started doing stuff with riak
(vs just reading about it and dreaming)
16:46 <notbenh> though from the little that I've read it looks like riak_search indexes the entire doc
16:46 <technoweenie> yea, riak search sounds awesome, i'm anxious to really dig into it
16:47 <notbenh> so more for keyword => post vs finding docs with a burried key
16:47 <notbenh> assuming that the post is stored just as the text vs a json obj that has content => $text
16:47 <notbenh> though I could completey be missing the boat as I've only read the blogpost
16:48 <technoweenie> there are search schemas
16:48 <notbenh> technoweenie: well I'm off to go read up on that because if I can
leverage search to do sub-doc indexing then that will change my schema greatly
16:48 <technoweenie>
16:51 <ericflo> technoweenie: I wonder if using schema you can tell it *not*
to index certain fields.
16:51 <ericflo> technoweenie: not sure on that one
16:51 <ericflo> technoweenie: just kidding, you can
16:52 <ericflo> technoweenie: {skip, true}
16:52 <technoweenie> nice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.