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 )
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 , 11 hours ago
| Description: | modified (diff) |
|---|
comment:2 by , 11 hours ago
| Priority: | low → lowest |
|---|
Note:
See TracTickets
for help on using tickets.

It won't help
MatchAll AND_NOT xas 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 ywhere currently a document matching or not matchingxdoesn't affect its weight. So it's actually even rarer than I'd thought.