Store weighted all_near_match with freqs

We need the freqs to calculate weight properly.

Some comments too.

Change-Id: Ifa142233134c77d077920fb29f3df7f54540cf8e
(cherry picked from commit 99f07266231a0bf6643c1e995f7a5719fe813960)
Merge "Store weighted all_near_match with freqs" into wmf/1.24wmf20