#157 closed defect (released)
Boolean filters shouldn't always combine with AND
Reported by: | Richard Boulton | Owned by: | Olly Betts |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | QueryParser | Version: | SVN trunk |
Severity: | normal | Keywords: | |
Cc: | Andreas Marienborg | Blocked By: | |
Blocking: | Operating System: | All |
Description
Currently, the query parser always combines boolean filter terms together with AND. In addition, it doesn't handle explicit boolean operators usefully (the result is sometimes useful, but not consistently).
The query parser should be modified to combine boolean filter terms with the same prefix together with OR, and then combine those groups with different prefixes together with AND. The query parser should also respect explicit operators, such that (where a and b are boolean prefixes for A and B).
"a:foo a:bar" becomes "Afoo OR Abar" "a:foo b:bar" becomes "Afoo AND Bbar" "a:foo AND a:bar" becomes "Afoo AND Abar" "a:foo OR b:bar" becomes "Afoo OR Abar"
A tricky case is:
"foo OR a:bar" - this could become "foo OR Abar", but the resulting weights may not be useful.
Attachments (6)
Change History (14)
by , 18 years ago
comment:1 by , 18 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:2 by , 18 years ago
Note - Olly pointed out that the patch doesn't handle value range filters correctly (since these don't have a prefix - instead having a slot number).
There's also the issue about what to do about prefixes which have multiple names
- eg, if add_prefix('author', 'A') and add_prefix('writer', 'A') have been
called, what should "author:foo writer:bar" produce? I'm tending towards thinking that "Afoo AND Abar" is appropriate, mainly because it's easier to document, but I'm not fully convinced.
comment:3 by , 18 years ago
Cc: | added |
---|
by , 18 years ago
Implementation of ORring filter terms with the same prefix
comment:4 by , 18 years ago
attachments.isobsolete: | 0 → 1 |
---|
by , 18 years ago
Attachment: | boolgroups.patch added |
---|
Updated implementation of ORring filter terms with the same prefix
comment:5 by , 18 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:6 by , 18 years ago
attachments.isobsolete: | 0 → 1 |
---|
by , 18 years ago
Attachment: | boolgroups.4.patch added |
---|
Further update - adds documentation and a test case
comment:7 by , 18 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:8 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied, so fixed in SVN HEAD.
Patch adding relevant tests to queryparsertest