like
a page and the page has likers
You can ask Unicorn for the adjacency list for a particular source vertex by its ID and the edge type:
likes: 5
Returns a sorted list of pages the user likes called hits.
(DocId, HitData)
pair
(sort-key, id)
I like how this gives you the flexibility to bring data into the posting list or leave it in TAO. However, you’d need to be careful not to make the posting list large. Even if you have enough RAM you still have small caches and limited RAM bandwidth.
You could also store data in the forward index described later.
<edge-type>:<id>
friend
and likers
are in the same vertical (both user
IDs) where likes
is not necessarily (results in a page ID)optional_count
or optional_weight
Example of WEAKAND searching for people named “Melanie Mars*” with a preference to friends of the user.
(weak-and
(term friend:3 :optional-hits 2)
(term melanie)
(term mars*)
)
APPLY - Similar to apply
in JavaScript
apply(prefix, innerQuery)
Allows for queries like:
(apply tagged: friend:5)
Instead of:
(or tagged:<id0> ... tagged:<idn>)
They give the example of looking for “People tagged in photos of Jon Jones”
Instead of looking up photos of Jon Jones and then people tagged in the photos, they store the ids of people tagged in the forward index of the photos.