I just submitted a pull request for KERN-3036 [1] that seemed way harder 
than it should be thanks to our Solr-plus-KV architecture. I'd like to 
challenge those who know a lot about Cassandra to see if that platform 
would make it easier to fix this issue.

Capsule version: To support /var/search/activity/all.json, we need a 
query that returns all the activities that point to nodes to which I 
have read permission. The read permission inheres in the nodes 
themselves, not in the activities (which just inherit their parents' 
permissions).

In a relational model it's an easy problem: Just a three-table join from 
Activity to Node to Permission.

In Solr, the fix was less straightforward. Solr joins (documented at 
[2]) are not fully equivalent to SQL joins. In particular, they're more 
like inner queries than like true SQL joins. Also, joins between two 
different types of documents must be made on fields that the two 
document types do NOT share. In other words the foreign key has to have 
a different name from the key it points to. These constraints made it 
tricky, but I did finally find the right Solr syntax for this search:

q=resourceType[* TO *]&fq={!join from=path 
to=activitysource}(readers:anonymous OR readers:everyone)

Does Cassandra make this case any easier? If so, show me how!

-chris

[1] https://jira.sakaiproject.org/browse/KERN-3036

[2] http://wiki.apache.org/solr/Join
_______________________________________________
oae-dev mailing list
[email protected]
http://collab.sakaiproject.org/mailman/listinfo/oae-dev

Reply via email to