Skip to content

Instantly share code, notes, and snippets.

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]],