Dang,

I'm sorry your question went unanswered for so long.  Sometimes they slip
through the cracks.  First, let me make sure I understand your data model.

1. You have users
2. You have content
3. Users generate and own content, a piece of content may have an arbitrary
number of tags
4. You want to be able to search content (full-text), furthermore this
search should only match against content a specific user owns, finally you
also want to be able to filter these results against the tags on the content

To be honest my knowledge of Riak links is very limited.  Conceptually it
seems like a fine way to model ownership of content, but perhaps one of my
colleagues  can speak more authoritatively to that.

That said, since you want full-text search on content I think using Riak's
built-in search solution makes sense.  Not only can it provide the
full-text searching you need but along with the noop/whitespace analyzers
and inline fields it can be used for filtering by tag as well.  You can
also tag each content with a user field and use search to determine all
content owned by a user to avoid links if necessary.  That said, let me add
some caveats before you decide to spend time with it:

1. Search is not fully compatible with Lucene/Solr, it's a limited subset.
 Do not expect it to be just like Solr.

2. Boolean queries with one or more low cardinality fields will cause pain
(e.g. `sex:male AND last_name:zezeski`).  This is where inline fields come
into play [1].

3. There is currently no anti-entropy in Search so if you lose replicas or
they become corrupted you will need to reindex all data [2].

You can find some documentation on Search here:
http://wiki.basho.com/Riak-Search.html

Also, in regards to your question on object size, we do recommend less than
64MB (realistically it should be much, much lower if you care about
latency).  Luwak should no longer be considered an option as we have EOL'd
it [3].  If you are asking because your docs (content) might be large then
perhaps you should think of making your docs more granular.  E.g. if you
are indexing books then perhaps a doc should be a chapter from the book.

-Ryan

[1]:
https://github.com/rzezeski/try-try-try/tree/master/2011/riak-search-inline-fields

[2]: https://issues.basho.com/show_bug.cgi?id=1304

[3]:
http://lists.basho.com/pipermail/riak-users_lists.basho.com/2011-December/006905.html

On Mon, Dec 12, 2011 at 4:53 PM, God Dang <godd...@hotmail.com> wrote:

>  Hi,
>
>  I'm trying to grok Links and 2i and are toying with some concepts for our
> schema design.
>
> Out usecase:
> -Users
> -Content that belongs to a user and ability for any given user to full
> text search their content (without seeing anyone else content). Also per
> user be able to tag the content and easily filter listings based on these
> tags.
>
> A design I've been toying with and been giving various stabs at code wise
> is:
> -A User bucket
> -Each user can have arbitrary contents related using Links.
> -A Content bucket
> -Content linked (on the user bucket and maybe reversed on each content) to
> a user
>
> Are Links indexed in any way and would a (good) option for implementing
> tags be an approach where we use the Tag field on each link to store the
> information(also maybe in the user value). Like: {{<<"User">>, <<"Link to
> content">>}, <<"Tag1, Tag2, Tag3, etc">>}, Best is of course if the tags
> are Indexed and I can feed these into a m/r job but I guess it would be
> feasible to do it "client" side also. Maybe a other (better) option is to
> put a 2i on each content with the Tag and feed the Link keys in to a m/r
> job that goes over the indexed tags?
>
> Is it possible using riak search to keep a per user index or do we have to
> roll our own? Or maybe some other smart approach.
>
> Also, I read somewhere that a Riak value is best served < ~64MB, is that
> true and should we use Luwak after that.
>
> Appreciate any insights.
>
> Thanks, -dang
>
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to