Build a whoosh scoring implementation that looks at how 'near' different terms are

StackOverflow https://stackoverflow.com/questions/17477703

  •  02-06-2022
  •  | 
  •  

سؤال

I need my score to take into account only how close the terms (in a multi-term search) are. It looks like in implementing your own weighting function (the docs), you only get access to one term of the search at once, so cannot look at distance between two terms.

هل كانت مفيدة؟

المحلول

The best solution I've found is to index each sentence alone. This isn't ideal, since it'll allow no highly scored exceptions to come through.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top