顾笑群
2016-Jan-16 09:15 UTC
Does Xapian support query string like "(age: 1..25) OR (age: 35..50)"? or "(age: 1..25) - (age: 35..50)"?
Hi, All 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. Thanks Best wish-Rafael Gu
Peter Van Dijk
2016-Jan-17 23:00 UTC
Does Xapian support query string like "(age: 1..25) OR (age: 35..50)"? or "(age: 1..25) - (age: 35..50)"?
On 16 January 2016 at 19:15, ??? <shoutrain_goo at aliyun.com> wrote:> Hi, All > 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. > Thanks > Best wish-Rafael Gu >Sure does - look up 'value ranges' in the documentation - there's some good examples of how to approach it in there. -- Peter
Olly Betts
2016-Jan-20 02:46 UTC
Does Xapian support query string like "(age: 1..25) OR (age: 35..50)"? or "(age: 1..25) - (age: 35..50)"?
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
Possibly Parallel Threads
- Does Xapian support query string like "(age: 1..25) OR (age: 35..50)"? or "(age: 1..25) - (age: 35..50)"?
- Does Xapian support query string like “x: 1..2 OR x: 8..10”? I cannot figure it out
- Xapian-discuss Digest, Vol 88, Issue 9
- About Xapian vs ElasticSearch
- use xapian.Query.OP_VALUE_RANGE or use xapian.MatchDecider?