Opened 10 years ago

Last modified 4 years ago

#400 new enhancement

Optimise AND_MAYBE when the RHS has a maxweight of 0

Reported by: richard Owned by: olly
Priority: normal Milestone: 1.4.x
Component: Matcher Version: SVN trunk
Severity: minor Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

If the RHS of an AND_MAYBE clause has an RHS whose maxweight is 0 (or becomes zero during the search), the AND_MAYBE could be replaced with the LHS. The attached patch does this. However, it doesn't quite work, due to two side effects:

  • if the AND_MAYBE is part of an OP_SYNONYM, the wdf of the RHS of the AND_MAYBE can have an effect, but will be lost.
  • if a percentage weight calculation is in effect, the count of the number of terms matching will miss those in the AND_MAYBE.

This doesn't change API at all, so doesn't need to be fixed during the 1.1 series.

Attachments (1)

badopt.patch (7.6 KB) - added by richard 10 years ago.
Optimisation for AND_MAYBE which doesn't quite work right.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by richard

Optimisation for AND_MAYBE which doesn't quite work right.

comment:1 Changed 7 years ago by olly

  • Milestone changed from 1.2.x to 1.3.x

comment:2 Changed 4 years ago by olly

It is certainly feasible to check if we're under OP_SYNONYM.

The count of matching subqueries is more problematic though - at present we always do count them, and to avoid that we'd need to have the user specify up front if they want percentages.

I guess this is useful for a PostingSource which adds weight, and such posting sources quite often match all documents - we could perhaps detect that and know we could do this optimisation (and just adjust the count appropriately).

This seems quite an esoteric case, and unlikely to be a huge win even then, so I don't think it should block 1.4.0.

comment:3 Changed 4 years ago by olly

  • Milestone changed from 1.3.x to 1.4.x
Note: See TracTickets for help on using tickets.