From 63b504cca50f820de5a43677ad6ba5b0969f1992 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 25 Jan 2017 16:09:40 +1300 Subject: [PATCH] Drop OP_SCALE_WEIGHT over OP_VALUE_* in Query ctor OP_VALUE_RANGE, OP_VALUE_GE and OP_VALUE_LE always return weight 0 so OP_SCALE_WEIGHT over them has no effect. Eliminating it at query construction time is cheap (just need to check the subquery's type), eliminates the confusing "0 * " from the query description, and means the OP_SCALE_WEIGHT object can be released sooner. Inspired by Shivanshu Chauhan asking about the query description on IRC. --- xapian-bindings/lua/smoketest.lua | 2 +- xapian-bindings/perl/t/parser.t | 46 +++++++++---------- xapian-bindings/php/smoketest.php | 2 +- xapian-bindings/php7/smoketest.php | 2 +- xapian-bindings/python/pythontest.py | 8 ++-- xapian-bindings/python/smoketest.py | 2 +- xapian-bindings/python3/pythontest.py | 8 ++-- xapian-bindings/python3/smoketest.py | 2 +- xapian-core/api/query.cc | 15 +++++- xapian-core/tests/api_queryparser.cc | 86 +++++++++++++++++------------------ 10 files changed, 92 insertions(+), 81 deletions(-) diff --git a/xapian-bindings/lua/smoketest.lua b/xapian-bindings/lua/smoketest.lua index 48f897b12..0ceb4119b 100644 --- a/xapian-bindings/lua/smoketest.lua +++ b/xapian-bindings/lua/smoketest.lua @@ -186,7 +186,7 @@ function run_tests() vrpdate = xapian.DateValueRangeProcessor(1, true, 1960) qp:add_valuerangeprocessor(vrpdate) query = qp:parse_query("12/03/99..12/04/01") - expect(tostring(query), "Query(0 * VALUE_RANGE 1 19991203 20011204)") + expect(tostring(query), "Query(VALUE_RANGE 1 19991203 20011204)") -- Check FieldProcessor works qp:add_prefix('test', function (s) return "foo" end) diff --git a/xapian-bindings/perl/t/parser.t b/xapian-bindings/perl/t/parser.t index b4ae9ed39..b5e57cb13 100644 --- a/xapian-bindings/perl/t/parser.t +++ b/xapian-bindings/perl/t/parser.t @@ -76,16 +76,16 @@ $qp->add_boolean_prefix("test", "XTEST"); my $pair; foreach $pair ( - [ 'a..b', '0 * VALUE_RANGE 1 a b' ], - [ '$50..100', '0 * VALUE_RANGE 1 $50 100' ], - [ '$50..$99', '0 * VALUE_RANGE 1 $50 $99' ], + [ 'a..b', 'VALUE_RANGE 1 a b' ], + [ '$50..100', 'VALUE_RANGE 1 $50 100' ], + [ '$50..$99', 'VALUE_RANGE 1 $50 $99' ], [ '$50..$100', '' ], - [ '02/03/1979..10/12/1980', '0 * VALUE_RANGE 1 02/03/1979 10/12/1980' ], + [ '02/03/1979..10/12/1980', 'VALUE_RANGE 1 02/03/1979 10/12/1980' ], [ 'a..b hello', '(hello@1 FILTER VALUE_RANGE 1 a b)' ], [ 'hello a..b', '(hello@1 FILTER VALUE_RANGE 1 a b)' ], [ 'hello a..b world', '((hello@1 OR world@2) FILTER VALUE_RANGE 1 a b)' ], [ 'hello a..b test:foo', '(hello@1 FILTER (VALUE_RANGE 1 a b AND XTESTfoo))' ], - [ '-5..7', '0 * VALUE_RANGE 1 -5 7' ], + [ '-5..7', 'VALUE_RANGE 1 -5 7' ], [ 'hello -5..7', '(hello@1 FILTER VALUE_RANGE 1 -5 7)' ], [ '-5..7 hello', '(hello@1 FILTER VALUE_RANGE 1 -5 7)' ], [ '"time flies" 09:00..12:30', '((time@1 PHRASE 2 flies@2) FILTER VALUE_RANGE 1 09:00 12:30)' ] @@ -114,23 +114,23 @@ $qp->add_valuerangeprocessor( $vrp3 ); $qp->add_boolean_prefix("test", "XTEST"); foreach $pair ( - [ 'a..b', '0 * VALUE_RANGE 3 a b' ], - [ '1..12', "0 * VALUE_RANGE 2 \\xa0 \\xae" ], - [ '20070201..20070228', '0 * VALUE_RANGE 1 20070201 20070228' ], - [ '$10..20', "0 * VALUE_RANGE 4 \\xad \\xb1" ], - [ '$10..$20', "0 * VALUE_RANGE 4 \\xad \\xb1" ], - [ '12..42kg', "0 * VALUE_RANGE 5 \\xae \\xb5\@" ], - [ '12kg..42kg', "0 * VALUE_RANGE 5 \\xae \\xb5\@" ], - [ '12kg..42', '0 * VALUE_RANGE 3 12kg 42' ], + [ 'a..b', 'VALUE_RANGE 3 a b' ], + [ '1..12', "VALUE_RANGE 2 \\xa0 \\xae" ], + [ '20070201..20070228', 'VALUE_RANGE 1 20070201 20070228' ], + [ '$10..20', "VALUE_RANGE 4 \\xad \\xb1" ], + [ '$10..$20', "VALUE_RANGE 4 \\xad \\xb1" ], + [ '12..42kg', "VALUE_RANGE 5 \\xae \\xb5\@" ], + [ '12kg..42kg', "VALUE_RANGE 5 \\xae \\xb5\@" ], + [ '12kg..42', 'VALUE_RANGE 3 12kg 42' ], [ '10..$20', '' ], - [ '1999-03-12..2020-12-30', '0 * VALUE_RANGE 1 19990312 20201230' ], - [ '1999/03/12..2020/12/30', '0 * VALUE_RANGE 1 19990312 20201230' ], - [ '1999.03.12..2020.12.30', '0 * VALUE_RANGE 1 19990312 20201230' ], - [ '12/03/99..12/04/01', '0 * VALUE_RANGE 1 19990312 20010412' ], - [ '03-12-99..04-14-01', '0 * VALUE_RANGE 1 19990312 20010414' ], + [ '1999-03-12..2020-12-30', 'VALUE_RANGE 1 19990312 20201230' ], + [ '1999/03/12..2020/12/30', 'VALUE_RANGE 1 19990312 20201230' ], + [ '1999.03.12..2020.12.30', 'VALUE_RANGE 1 19990312 20201230' ], + [ '12/03/99..12/04/01', 'VALUE_RANGE 1 19990312 20010412' ], + [ '03-12-99..04-14-01', 'VALUE_RANGE 1 19990312 20010414' ], [ '(test:a..test:b hello)', '(hello@1 FILTER VALUE_RANGE 3 test:a test:b)' ], - [ 'country:chile..denmark', '0 * VALUE_RANGE 6 chile denmark' ], - [ 'albert..xeni:name', '0 * VALUE_RANGE 7 albert xeni' ], + [ 'country:chile..denmark', 'VALUE_RANGE 6 chile denmark' ], + [ 'albert..xeni:name', 'VALUE_RANGE 7 albert xeni' ], ) { my ($str, $res) = @{$pair}; my $query = $qp->parse_query($str); @@ -145,9 +145,9 @@ $qp = new Xapian::QueryParser(); } foreach $pair ( - [ '12/03/99..12/04/01', '0 * VALUE_RANGE 1 19991203 20011204' ], - [ '03-12-99..04-14-01', '0 * VALUE_RANGE 1 19990312 20010414' ], - [ '01/30/60..02/02/59', '0 * VALUE_RANGE 1 19600130 20590202' ], + [ '12/03/99..12/04/01', 'VALUE_RANGE 1 19991203 20011204' ], + [ '03-12-99..04-14-01', 'VALUE_RANGE 1 19990312 20010414' ], + [ '01/30/60..02/02/59', 'VALUE_RANGE 1 19600130 20590202' ], ) { my ($str, $res) = @{$pair}; my $query = $qp->parse_query($str); diff --git a/xapian-bindings/php/smoketest.php b/xapian-bindings/php/smoketest.php index 8ae67b319..50d993333 100644 --- a/xapian-bindings/php/smoketest.php +++ b/xapian-bindings/php/smoketest.php @@ -301,7 +301,7 @@ function add_vrp_date(&$qp) { $qp = new XapianQueryParser(); add_vrp_date($qp); $query = $qp->parse_query('12/03/99..12/04/01'); -if ($query->get_description() !== 'Query(0 * VALUE_RANGE 1 19991203 20011204)') { +if ($query->get_description() !== 'Query(VALUE_RANGE 1 19991203 20011204)') { print "XapianDateValueRangeProcessor didn't work - result was ".$query->get_description()."\n"; exit(1); } diff --git a/xapian-bindings/php7/smoketest.php b/xapian-bindings/php7/smoketest.php index 8ae67b319..50d993333 100644 --- a/xapian-bindings/php7/smoketest.php +++ b/xapian-bindings/php7/smoketest.php @@ -301,7 +301,7 @@ function add_vrp_date(&$qp) { $qp = new XapianQueryParser(); add_vrp_date($qp); $query = $qp->parse_query('12/03/99..12/04/01'); -if ($query->get_description() !== 'Query(0 * VALUE_RANGE 1 19991203 20011204)') { +if ($query->get_description() !== 'Query(VALUE_RANGE 1 19991203 20011204)') { print "XapianDateValueRangeProcessor didn't work - result was ".$query->get_description()."\n"; exit(1); } diff --git a/xapian-bindings/python/pythontest.py b/xapian-bindings/python/pythontest.py index 3f86ceb52..e9ab08ecc 100644 --- a/xapian-bindings/python/pythontest.py +++ b/xapian-bindings/python/pythontest.py @@ -869,7 +869,7 @@ def test_queryparser_custom_vrp(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_queryparser_custom_vrp_deallocation(): """Test that QueryParser doesn't delete ValueRangeProcessors too soon. @@ -892,7 +892,7 @@ def test_queryparser_custom_vrp_deallocation(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_queryparser_custom_rp(): """Test QueryParser with a custom (in python) RangeProcessor. @@ -914,7 +914,7 @@ def test_queryparser_custom_rp(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_queryparser_custom_rp_deallocation(): """Test that QueryParser doesn't delete RangeProcessors too soon. @@ -939,7 +939,7 @@ def test_queryparser_custom_rp_deallocation(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_scale_weight(): """Test query OP_SCALE_WEIGHT feature. diff --git a/xapian-bindings/python/smoketest.py b/xapian-bindings/python/smoketest.py index 507572b84..14421b00a 100644 --- a/xapian-bindings/python/smoketest.py +++ b/xapian-bindings/python/smoketest.py @@ -362,7 +362,7 @@ def test_all(): vrpdate = xapian.DateValueRangeProcessor(1, 1, 1960) qp.add_valuerangeprocessor(vrpdate) query = qp.parse_query('12/03/99..12/04/01') - expect(str(query), 'Query(0 * VALUE_RANGE 1 19991203 20011204)') + expect(str(query), 'Query(VALUE_RANGE 1 19991203 20011204)') # Regression test for bug#193, fixed in 1.0.3. context("running regression test for bug#193") diff --git a/xapian-bindings/python3/pythontest.py b/xapian-bindings/python3/pythontest.py index 2e7ef1eeb..ba30bf633 100644 --- a/xapian-bindings/python3/pythontest.py +++ b/xapian-bindings/python3/pythontest.py @@ -863,7 +863,7 @@ def test_queryparser_custom_vrp(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_queryparser_custom_vrp_deallocation(): """Test that QueryParser doesn't delete ValueRangeProcessors too soon. @@ -886,7 +886,7 @@ def test_queryparser_custom_vrp_deallocation(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_queryparser_custom_rp(): """Test QueryParser with a custom (in python) RangeProcessor. @@ -908,7 +908,7 @@ def test_queryparser_custom_rp(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_queryparser_custom_rp_deallocation(): """Test that QueryParser doesn't delete RangeProcessors too soon. @@ -933,7 +933,7 @@ def test_queryparser_custom_rp_deallocation(): query = queryparser.parse_query('5..8') expect(str(query), - 'Query(0 * VALUE_RANGE 7 A5 B8)') + 'Query(VALUE_RANGE 7 A5 B8)') def test_scale_weight(): """Test query OP_SCALE_WEIGHT feature. diff --git a/xapian-bindings/python3/smoketest.py b/xapian-bindings/python3/smoketest.py index 18e1da36c..4ce1c8219 100644 --- a/xapian-bindings/python3/smoketest.py +++ b/xapian-bindings/python3/smoketest.py @@ -370,7 +370,7 @@ def test_all(): vrpdate = xapian.DateValueRangeProcessor(1, 1, 1960) qp.add_valuerangeprocessor(vrpdate) query = qp.parse_query(b'12/03/99..12/04/01') - expect(str(query), 'Query(0 * VALUE_RANGE 1 19991203 20011204)') + expect(str(query), 'Query(VALUE_RANGE 1 19991203 20011204)') # Regression test for bug#193, fixed in 1.0.3. context("running regression test for bug#193") diff --git a/xapian-core/api/query.cc b/xapian-core/api/query.cc index a7926a270..7e20d8013 100644 --- a/xapian-core/api/query.cc +++ b/xapian-core/api/query.cc @@ -68,8 +68,19 @@ Query::Query(op op_, const Xapian::Query & subquery, double factor) throw Xapian::InvalidArgumentError("op must be OP_SCALE_WEIGHT"); // If the subquery is MatchNothing then generate Query() which matches // nothing. - if (subquery.internal.get()) - internal = new Xapian::Internal::QueryScaleWeight(factor, subquery); + if (!subquery.internal.get()) return; + switch (subquery.internal->get_type()) { + case OP_VALUE_RANGE: + case OP_VALUE_GE: + case OP_VALUE_LE: + // These operators always return weight 0, so OP_SCALE_WEIGHT has + // no effect on them. + internal = subquery.internal; + return; + default: + break; + } + internal = new Xapian::Internal::QueryScaleWeight(factor, subquery); } Query::Query(op op_, Xapian::valueno slot, const std::string & limit) diff --git a/xapian-core/tests/api_queryparser.cc b/xapian-core/tests/api_queryparser.cc index 3419570cd..86c256f86 100644 --- a/xapian-core/tests/api_queryparser.cc +++ b/xapian-core/tests/api_queryparser.cc @@ -1371,11 +1371,11 @@ DEFINE_TESTCASE(qp_unstem_boolean_prefix, !backend) { } static const test test_value_range1_queries[] = { - { "a..b", "0 * VALUE_RANGE 1 a b" }, - { "$50..100", "0 * VALUE_RANGE 1 $50 100" }, - { "$50..$99", "0 * VALUE_RANGE 1 $50 $99" }, + { "a..b", "VALUE_RANGE 1 a b" }, + { "$50..100", "VALUE_RANGE 1 $50 100" }, + { "$50..$99", "VALUE_RANGE 1 $50 $99" }, { "$50..$100", "" }, // start > range - { "02/03/1979..10/12/1980", "0 * VALUE_RANGE 1 02/03/1979 10/12/1980" }, + { "02/03/1979..10/12/1980", "VALUE_RANGE 1 02/03/1979 10/12/1980" }, { "a..b hello", "(hello@1 FILTER VALUE_RANGE 1 a b)" }, { "hello a..b", "(hello@1 FILTER VALUE_RANGE 1 a b)" }, { "hello a..b world", "((hello@1 OR world@2) FILTER VALUE_RANGE 1 a b)" }, @@ -1383,15 +1383,15 @@ static const test test_value_range1_queries[] = { { "hello a..b test:foo test:bar", "(hello@1 FILTER (VALUE_RANGE 1 a b AND (XTESTfoo OR XTESTbar)))" }, { "hello a..b c..d test:foo", "(hello@1 FILTER ((VALUE_RANGE 1 a b OR VALUE_RANGE 1 c d) AND XTESTfoo))" }, { "hello a..b c..d test:foo test:bar", "(hello@1 FILTER ((VALUE_RANGE 1 a b OR VALUE_RANGE 1 c d) AND (XTESTfoo OR XTESTbar)))" }, - { "-5..7", "0 * VALUE_RANGE 1 -5 7" }, + { "-5..7", "VALUE_RANGE 1 -5 7" }, { "hello -5..7", "(hello@1 FILTER VALUE_RANGE 1 -5 7)" }, { "-5..7 hello", "(hello@1 FILTER VALUE_RANGE 1 -5 7)" }, { "\"time flies\" 09:00..12:30", "((time@1 PHRASE 2 flies@2) FILTER VALUE_RANGE 1 09:00 12:30)" }, // Feature test for single-ended ranges (ticket#480): - { "..b", "0 * VALUE_LE 1 b" }, - { "a..", "0 * VALUE_GE 1 a" }, + { "..b", "VALUE_LE 1 b" }, + { "a..", "VALUE_GE 1 a" }, // Test for expanded set of characters allowed in range start: - { "10:30+1300..11:00+1300", "0 * VALUE_RANGE 1 10:30+1300 11:00+1300" }, + { "10:30+1300..11:00+1300", "VALUE_RANGE 1 10:30+1300 11:00+1300" }, { NULL, NULL } }; @@ -1454,35 +1454,35 @@ DEFINE_TESTCASE(qp_range1, !backend) { } static const test test_value_range2_queries[] = { - { "a..b", "0 * VALUE_RANGE 3 a b" }, - { "1..12", "0 * VALUE_RANGE 2 \\xa0 \\xae" }, - { "20070201..20070228", "0 * VALUE_RANGE 1 20070201 20070228" }, - { "$10..20", "0 * VALUE_RANGE 4 \\xad \\xb1" }, - { "$10..$20", "0 * VALUE_RANGE 4 \\xad \\xb1" }, + { "a..b", "VALUE_RANGE 3 a b" }, + { "1..12", "VALUE_RANGE 2 \\xa0 \\xae" }, + { "20070201..20070228", "VALUE_RANGE 1 20070201 20070228" }, + { "$10..20", "VALUE_RANGE 4 \\xad \\xb1" }, + { "$10..$20", "VALUE_RANGE 4 \\xad \\xb1" }, // Feature test for single-ended ranges (ticket#480): - { "$..20", "0 * VALUE_LE 4 \\xb1" }, - { "..$20", "0 * VALUE_LE 3 $20" }, // FIXME: probably should parse as $..20 - { "$10..", "0 * VALUE_GE 4 \\xad" }, - { "12..42kg", "0 * VALUE_RANGE 5 \\xae \\xb5@" }, - { "12kg..42kg", "0 * VALUE_RANGE 5 \\xae \\xb5@" }, - { "12kg..42", "0 * VALUE_RANGE 3 12kg 42" }, + { "$..20", "VALUE_LE 4 \\xb1" }, + { "..$20", "VALUE_LE 3 $20" }, // FIXME: probably should parse as $..20 + { "$10..", "VALUE_GE 4 \\xad" }, + { "12..42kg", "VALUE_RANGE 5 \\xae \\xb5@" }, + { "12kg..42kg", "VALUE_RANGE 5 \\xae \\xb5@" }, + { "12kg..42", "VALUE_RANGE 3 12kg 42" }, { "10..$20", "" }, // start > end - { "1999-03-12..2020-12-30", "0 * VALUE_RANGE 1 19990312 20201230" }, - { "1999/03/12..2020/12/30", "0 * VALUE_RANGE 1 19990312 20201230" }, - { "1999.03.12..2020.12.30", "0 * VALUE_RANGE 1 19990312 20201230" }, + { "1999-03-12..2020-12-30", "VALUE_RANGE 1 19990312 20201230" }, + { "1999/03/12..2020/12/30", "VALUE_RANGE 1 19990312 20201230" }, + { "1999.03.12..2020.12.30", "VALUE_RANGE 1 19990312 20201230" }, // Feature test for single-ended ranges (ticket#480): - { "..2020.12.30", "0 * VALUE_LE 1 20201230" }, - { "1999.03.12..", "0 * VALUE_GE 1 19990312" }, - { "12/03/99..12/04/01", "0 * VALUE_RANGE 1 19990312 20010412" }, - { "03-12-99..04-14-01", "0 * VALUE_RANGE 1 19990312 20010414" }, + { "..2020.12.30", "VALUE_LE 1 20201230" }, + { "1999.03.12..", "VALUE_GE 1 19990312" }, + { "12/03/99..12/04/01", "VALUE_RANGE 1 19990312 20010412" }, + { "03-12-99..04-14-01", "VALUE_RANGE 1 19990312 20010414" }, { "(test:a..test:b hello)", "(hello@1 FILTER VALUE_RANGE 3 test:a test:b)" }, { "12..42kg 5..6kg 1..12", "0 * (VALUE_RANGE 2 \\xa0 \\xae AND (VALUE_RANGE 5 \\xae \\xb5@ OR VALUE_RANGE 5 \\xa9 \\xaa))" }, // Check that a VRP which fails to match doesn't remove a prefix or suffix. // 1.0.13/1.1.1 and earlier got this wrong in some cases. - { "$12a..13", "0 * VALUE_RANGE 3 $12a 13" }, - { "$12..13b", "0 * VALUE_RANGE 3 $12 13b" }, - { "$12..12kg", "0 * VALUE_RANGE 3 $12 12kg" }, - { "12..b12kg", "0 * VALUE_RANGE 3 12 b12kg" }, + { "$12a..13", "VALUE_RANGE 3 $12a 13" }, + { "$12..13b", "VALUE_RANGE 3 $12 13b" }, + { "$12..12kg", "VALUE_RANGE 3 $12 12kg" }, + { "12..b12kg", "VALUE_RANGE 3 12 b12kg" }, { NULL, NULL } }; @@ -1651,7 +1651,7 @@ DEFINE_TESTCASE(qp_range3, writable) { static const test test_value_range4_queries[] = { { "id:19254@foo..example.com", "0 * Q19254@foo..example.com" }, { "hello:world", "0 * XHELLOworld" }, - { "hello:mum..world", "0 * VALUE_RANGE 1 mum world" }, + { "hello:mum..world", "VALUE_RANGE 1 mum world" }, { NULL, NULL } }; @@ -1726,10 +1726,10 @@ DEFINE_TESTCASE(qp_range4, !backend) { } static const test test_value_daterange1_queries[] = { - { "12/03/99..12/04/01", "0 * VALUE_RANGE 1 19991203 20011204" }, - { "03-12-99..04-14-01", "0 * VALUE_RANGE 1 19990312 20010414" }, - { "01/30/60..02/02/59", "0 * VALUE_RANGE 1 19600130 20590202" }, - { "1999-03-12..2001-04-14", "0 * VALUE_RANGE 1 19990312 20010414" }, + { "12/03/99..12/04/01", "VALUE_RANGE 1 19991203 20011204" }, + { "03-12-99..04-14-01", "VALUE_RANGE 1 19990312 20010414" }, + { "01/30/60..02/02/59", "VALUE_RANGE 1 19600130 20590202" }, + { "1999-03-12..2001-04-14", "VALUE_RANGE 1 19990312 20010414" }, { "12/03/99..02", "Unknown range operation" }, { "1999-03-12..2001", "Unknown range operation" }, { NULL, NULL } @@ -1792,11 +1792,11 @@ DEFINE_TESTCASE(qp_daterange1, !backend) { } static const test test_value_daterange2_queries[] = { - { "created:12/03/99..12/04/01", "0 * VALUE_RANGE 1 19991203 20011204" }, - { "modified:03-12-99..04-14-01", "0 * VALUE_RANGE 2 19990312 20010414" }, - { "accessed:01/30/70..02/02/69", "0 * VALUE_RANGE 3 19700130 20690202" }, + { "created:12/03/99..12/04/01", "VALUE_RANGE 1 19991203 20011204" }, + { "modified:03-12-99..04-14-01", "VALUE_RANGE 2 19990312 20010414" }, + { "accessed:01/30/70..02/02/69", "VALUE_RANGE 3 19700130 20690202" }, // In <=1.2.12, and in 1.3.0, this gave "Unknown range operation": - { "deleted:12/03/99..12/04/01", "0 * VALUE_RANGE 4 19990312 20010412" }, + { "deleted:12/03/99..12/04/01", "VALUE_RANGE 4 19990312 20010412" }, { "1999-03-12..2001-04-14", "Unknown range operation" }, { "12/03/99..created:12/04/01", "Unknown range operation" }, { "12/03/99created:..12/04/01", "Unknown range operation" }, @@ -1882,8 +1882,8 @@ DEFINE_TESTCASE(qp_daterange2, !backend) { } static const test test_value_stringrange1_queries[] = { - { "tag:bar..foo", "0 * VALUE_RANGE 1 bar foo" }, - { "bar..foo", "0 * VALUE_RANGE 0 bar foo" }, + { "tag:bar..foo", "VALUE_RANGE 1 bar foo" }, + { "bar..foo", "VALUE_RANGE 0 bar foo" }, { NULL, NULL } }; @@ -2111,8 +2111,8 @@ class DateRangeFieldProcessor : public Xapian::FieldProcessor { }; static const test test_fieldproc2_queries[] = { - { "date:\"this week\"", "0 * VALUE_GE 1 20120723" }, - { "date:23/7/2012..25/7/2012", "0 * VALUE_RANGE 1 20120723 20120725" }, + { "date:\"this week\"", "VALUE_GE 1 20120723" }, + { "date:23/7/2012..25/7/2012", "VALUE_RANGE 1 20120723 20120725" }, { NULL, NULL } }; -- 2.11.4.GIT