jleivaizq/djorm-ext-pgtrgm — pull request #12 by hobson (2014-08-05 21:39:27+00:00)
Title: distance is the INVERSE of similarity

Naming the annotated field for the similarity score a "distance" is confusing and wrong. The more similar things are the closer they are, not the more distant they are. This is why similarity must be sorted in decreasing order (the minus sign in the order_by filter) for the best match to be at the start of the list. "Distance" is the inverse (or negative, or opposite) of "similarity".