Skip to content

Instantly share code, notes, and snippets.

@marmbrus
Created March 2, 2010 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marmbrus/319936 to your computer and use it in GitHub Desktop.
Save marmbrus/319936 to your computer and use it in GitHub Desktop.
def thoughtstream(count: Int)(implicit env: Environment):Seq[thought] = {
qLogger.debug("Executing query 'thoughtstream'")
topK(IntegerField(count),
sort(List("timestamp"), true,
materialize(classOf[thought],
sequentialDereferenceIndex("ent_thought", ReadRandomPolicy,
prefixJoin("idxthoughtowner_timestamp", List(AttributeCondition("name")), IntegerField(count), true, ReadRandomPolicy,
materialize(classOf[user],
pointerJoin("ent_user", List(AttributeCondition("target")), ReadRandomPolicy,
selection(HashMap(("approved", TrueField)).asInstanceOf[HashMap[String, Field]],
materialize(classOf[subscription],
prefixJoin("ent_subscription", List(AttributeCondition("name")), IntegerField(5000), true, ReadRandomPolicy,
materialize(classOf[user],
singleGet("ent_user", name, ReadRandomPolicy)
)
)
)
)
)
)
)
)
)
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment