Candidate documents from the corpus can be retrieved and ranked using a variety of methods. [[Relevance (information retrievalvari)|Relevance]] [[ranking]]s of documents in a keyword search can be calculated, using the assumptions of [[semantic similarity|document similarities]] theory, by comparing the deviation of angles between each document vector and the original query vector where the query is represented as a vector with same dimension as the vectors that represent thedevi other documents.
In practice, it is easier to calculate the [[cosine]] of the angle between the vectors, instead of the angle itself: