Does Xapian support query string like "(age: 1..25) OR (age: 35..50)"? or "(age: 1..25) - (age: 35..50)"?

Olly Betts olly at survex.com
Wed Jan 20 02:46:50 GMT 2016


On Mon, Jan 18, 2016 at 09:00:46AM +1000, Peter Van Dijk wrote:
> On 16 January 2016 at 19:15, 顾笑群 <shoutrain_goo at aliyun.com> wrote:
> > Does Xapian support query string like "(age: 1..25) OR (age: 35..50)"? or
> > "(age: 1..25) - (age: 35..50)"?
> > I want to get the results with age range from 1 to 25, 35 to 50.
> >
> > I tested, "(age: 1..25) OR (age: 35..50)"? or "(age: 1..25) - (age:
> > 35..50)" doesn't work.
> 
> Sure does - look up 'value ranges' in the documentation - there's some good
> examples of how to approach it in there.

Indeed.

Note though that you can't put a space after the prefix, so (once you've
configured a range with prefix "age:", it would be:

  age:1..25 OR age:35..50

Not sure what you're expecting for:

  <range1> - <range2>

My guess would be you want 'NOT' there, except that the ranges in your
example don't overlap, so that wouldn't ever match anything.  But you
could usefully say:

  age:1..25 NOT age:10..12

Cheers,
    Olly



More information about the Xapian-discuss mailing list