[Xapian-tickets] [Xapian] #234: add an option to specify whether filter terms of a given prefix should be ORed or ANDed together

Xapian nobody at xapian.org
Thu Nov 12 22:23:15 GMT 2015


#234: add an option to specify whether filter terms of a given prefix should be
ORed or ANDed together
---------------------------+------------------------------
 Reporter:  tv+xapian.org  |             Owner:  olly
     Type:  enhancement    |            Status:  assigned
 Priority:  normal         |         Milestone:  1.3.x
Component:  Omega          |           Version:  SVN trunk
 Severity:  minor          |        Resolution:
 Keywords:                 |        Blocked By:
 Blocking:                 |  Operating System:  All
---------------------------+------------------------------

Comment (by olly):

 `diff4ORopOption​` is changing the wrong thing - that's the default
 operator used for "probabilistic" queries (i.e. for fields where the text
 is split into words at whitespace, etc).  I think this patch was probably
 meant for #512.

 This ticket is about allowing control of the operator used when there are
 multiple filters in the query - e.g.:

 {{{
 baked potatoes host:recipes.com host:cooking.org type:pdf type:ps
 }}}

 The current Omega logic is that filters with the same prefix are OR-ed
 together, and then those groups are AND-ed together - the above example is
 interpreted as:

 {{{
 (baked potatoes) AND (host:recipes.com OR host:cooking.org) AND (type:pdf
 OR type:ps)
 }}}

 Generally that does the sensible thing - it's certainly what you want for
 `type:` (where a document only has one type), or for a case where it can
 have multiple values, but they're strictly supersets/subsets (if you index
 a `host:` term for each level of the domain, e.g. documents on
 vegan.recipes.com could be selected by any of the filters
 `host:vegan.recipes.com`, `host:recipes.com` or `host:com`, then OR-ing
 multiple `host:` filters also makes most sense).

 But sometimes a filter prefix has overlapping terms, and you actually want
 them AND-ed.  E.g. for `colour:` you might want `colour:red colour:blue`
 to return only the items which are part red and part blue.

 Thomas' original patch is along the right lines - we should probably apply
 something like this before 1.4.0.

--
Ticket URL: <http://trac.xapian.org/ticket/234#comment:9>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list