Opened 11 hours ago

Last modified 11 hours ago

#860 new enhancement

weighted NOT?

Reported by: Olly Betts Owned by: Olly Betts
Priority: lowest Milestone: 2.x
Component: Matcher Version: git main
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description (last modified by Olly Betts)

MatchAll AND_NOT x in a weighted context could potentially be weighted, like OP_SYNONYM is with estimated stats, e.g.:

  • termfreq(NOT x) = db.get_doccount() - termfreq(x)
  • wdf = 1
  • collfreq(NOT x) = termfreq(NOT x)

This should give better ranking for queries which have MatchAll AND_NOT x in a weighted context. Such queries are likely fairly rare as PURE_NOT is off by default in the QueryParser. Setting as low priority due to this and because nobody has asked for this (it occurred to me while working on the code).

Marking as 2.x as this could be slotted into a point release.

Change History (2)

comment:1 by Olly Betts, 11 hours ago

Description: modified (diff)

comment:2 by Olly Betts, 11 hours ago

Priority: low → lowest

This should give better ranking for queries which have MatchAll AND_NOT x in a weighted context.

It won't help MatchAll AND_NOT x as the whole query though, since tf, wdf, collfreq and other stats are going to be the same for documents where the query matches, so all matching documents get the same weight. If we do this, we should probably not weight this case as it's just useless extra work to calculate the stats and weights.

A case where it could help is (NOT x) OR y where currently a document matching or not matching x doesn't affect its weight. So it's actually even rarer than I'd thought.

Note: See TracTickets for help on using tickets.