This function computes the distance from a defined origin. Since
the value of the document is read from the index, it cannot be
guaranteed that the value actually exists. If it does not, we assume
the user handles this case in the query and return 0.
public final LeafScoreFunction getLeafScoreFunction(org.apache.lucene.index.LeafReaderContext ctx)