The example from the documentation does not work as expected. It creates wrong results:
query emb = [1 1 1 1 0]
match emb = [1. 1.2 1. 1. 0. ] score = 1.2806248474865694
match emb = [1. 2.2 2. 1. 0. ] score = 0.19999999999999787
match emb = [1. 0.1 0. 0. 0. ] score = 2.9342801502242417
The reason is, that if only_id is set to False (which is the default), it uses the same in-memory objects if a Document happens to be a match for two queries. Then scores are overwritten.
The example from the documentation does not work as expected. It creates wrong results:
The reason is, that if
only_idis set toFalse(which is the default), it uses the same in-memory objects if a Document happens to be a match for two queries. Then scores are overwritten.