From 6fd6a2ea04f5ad09a584f112f85a6012f2f4d3f1 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 9 May 2016 15:23:41 +1200 Subject: [PATCH] Update omegatest for grouping change The order of subqueries has changed in some cases. --- xapian-applications/omega/omegatest | 4 ++-- xapian-bindings/perl/Xapian/WritableDatabase.pm | 28 ++++++++++++------------- xapian-bindings/perl/t/databasemodified.t | 6 +++--- xapian-bindings/perl/t/writabledatabase.t | 18 ++++++++-------- xapian-bindings/python/pythontest.py | 4 ++-- xapian-bindings/python3/pythontest.py | 4 ++-- xapian-bindings/ruby/smoketest.rb | 4 ++-- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/xapian-applications/omega/omegatest b/xapian-applications/omega/omegatest index 99f708a57..f3fddbc7a 100755 --- a/xapian-applications/omega/omegatest +++ b/xapian-applications/omega/omegatest @@ -165,11 +165,11 @@ qtestcase '0 * Len' P=lang:en qtestcase 'XANDtest' B=XANDtest qtestcase '0 * XANDtest' P=and:test qtestcase '(Len AND XANDtest)' B=Len B=XANDtest -qtestcase '0 * (XANDtest AND Len)' P='lang:en and:test' +qtestcase '0 * (Len AND XANDtest)' P='lang:en and:test' qtestcase '(Len AND Lde)' B=Len B=Lde qtestcase '0 * (Len AND Lde)' P='lang:en lang:de' qtestcase '((Horg OR Hcom) AND (Len AND Lfr))' B=Len B=Lfr B=Horg B=Hcom -qtestcase '0 * ((Horg OR Hcom) AND (Len AND Lfr))' P='lang:en lang:fr host:org host:com' +qtestcase '0 * ((Len AND Lfr) AND (Horg OR Hcom))' P='lang:en lang:fr host:org host:com' qtestcase '((XANDa AND XANDb AND XANDc) AND (Y1998 OR Y2001))' B=Y1998 B=Y2001 B=XANDa B=XANDb B=XANDc qtestcase '0 * (((XANDa AND XANDb) AND XANDc) AND (Y1998 OR Y2001))' P='year:1998 year:2001 and:a and:b and:c' diff --git a/xapian-bindings/perl/Xapian/WritableDatabase.pm b/xapian-bindings/perl/Xapian/WritableDatabase.pm index c38f8690a..e33472781 100644 --- a/xapian-bindings/perl/Xapian/WritableDatabase.pm +++ b/xapian-bindings/perl/Xapian/WritableDatabase.pm @@ -23,17 +23,17 @@ These are exported by L with the 'db' option. Return a clone of this class. -=item flush +=item commit -Flush to disk any modifications made to the database. +Commit any modifications made to the database. For efficiency reasons, when performing multiple updates to a database it is best (indeed, almost essential) to make as many modifications as memory will permit in a single pass through the database. To ensure this, Xapian batches up modifications. -Flush may be called at any time to ensure that the modifications which have -been made are written to disk: if the flush succeeds, all the preceding +Commit may be called at any time to ensure that the modifications which have +been made are written to disk: if the commit succeeds, all the preceding modifications will have been written to disk. If any of the modifications fail, an exception will be thrown and the database @@ -42,10 +42,10 @@ deletion operation has either been fully performed or not performed at all: it is then up to the application to work out which operations need to be repeated. -Beware of calling flush too frequently: this will have a severe performance +Beware of calling commit too frequently: this will have a severe performance cost. -Note that flush need not be called explicitly: it will be called automatically +Note that commit need not be called explicitly: it will be called automatically when the database is closed, or when a sufficient number of modifications have been made. @@ -57,11 +57,11 @@ This method adds the specified document to the database, returning a newly allocated document ID. Note that this does not mean the document will immediately appear in the -database; see flush() for more details. +database; see commit() for more details. As with all database modification operations, the effect is atomic: the document will either be fully added, or the document fails to be added and -an exception is thrown (possibly at a later time when flush is called or the +an exception is thrown (possibly at a later time when commit is called or the database is closed). =item delete_document @@ -70,11 +70,11 @@ Delete a document from the database. This method removes the document with the specified document ID from the database. Note that this does not mean the document will immediately disappear from -the database; see flush() for more details. +the database; see commit() for more details. As with all database modification operations, the effect is atomic: the document will either be fully removed, or the document fails to be removed -and an exception is thrown (possibly at a later time when flush is called or +and an exception is thrown (possibly at a later time when commit is called or the database is closed). =item delete_document_by_term @@ -91,11 +91,11 @@ eplace a given document in the database. This method replaces the document with the specified document ID. Note that this does not mean the document will immediately change in the database; see -flush() for more details. +commit() for more details. As with all database modification operations, the effect is atomic: the document will either be fully replaced, or the document fails to be replaced -and an exception is thrown (possibly at a later time when flush is called or +and an exception is thrown (possibly at a later time when commit is called or the database is closed). =item replace_document_by_term @@ -111,11 +111,11 @@ The intended use is to allow UIDs from another system to easily be mapped to terms in Xapian, although this method probably has other uses. Note that this does not mean the document(s) will immediately change in the -database; see flush() for more details. +database; see commit() for more details. As with all database modification operations, the effect is atomic: the document(s) will either be fully replaced, or the document(s) fail to be -replaced and an exception is thrown (possibly at a later time when flush is +replaced and an exception is thrown (possibly at a later time when commit is called or the database is closed). =item reopen diff --git a/xapian-bindings/perl/t/databasemodified.t b/xapian-bindings/perl/t/databasemodified.t index 276ce05d6..ae664cf90 100644 --- a/xapian-bindings/perl/t/databasemodified.t +++ b/xapian-bindings/perl/t/databasemodified.t @@ -60,7 +60,7 @@ for my $num (1..1000) { $doc->add_value(0, $num); $write->add_document( $doc ); } -$write->flush(); +$write->commit(); $read->reopen(); for my $num (qw(three four five)) { @@ -73,9 +73,9 @@ for my $num (qw(three four five)) { $doc->add_value(0, $num); $write->add_document( $doc ); - $write->flush(); + $write->commit(); } -$write->flush(); +$write->commit(); eval { my $mset = $enq->get_mset(0, 10); }; diff --git a/xapian-bindings/perl/t/writabledatabase.t b/xapian-bindings/perl/t/writabledatabase.t index 479fe82e6..4b28d860c 100644 --- a/xapian-bindings/perl/t/writabledatabase.t +++ b/xapian-bindings/perl/t/writabledatabase.t @@ -53,7 +53,7 @@ for my $num (qw(three four five)) { $doc->add_value(0, $num); $write->add_document( $doc ); } -$write->flush(); +$write->commit(); my $doccount = $write->get_doccount(); is($doccount, 1003, "check number of documents in WritableDatabase"); @@ -72,7 +72,7 @@ ok(!$write->term_exists($num), "check term exists"); is($write->get_document($docid)->get_data(), "$term $docid", "check document data"); $write->replace_document($docid, $repdoc); -$write->flush(); +$write->commit(); $write->keep_alive(); @@ -98,7 +98,7 @@ is($write->get_termfreq($num), 0, "check term frequency"); is($write->get_termfreq($repterm), 1, "check term frequency"); $write->replace_document_by_term($repterm, $repdoc); -$write->flush(); +$write->commit(); ok($write->term_exists($num), "check term exists"); ok(!$write->term_exists($repterm), "check term exists"); @@ -118,7 +118,7 @@ is($write->get_termfreq($term), $doccount, "check term frequency"); is($write->get_termfreq($num), 0, "check term frequency"); $write->replace_document_by_term($num, $repdoc); -$write->flush(); +$write->commit(); $doccount = $write->get_doccount(); is($doccount, 1004, "check doccount"); @@ -137,7 +137,7 @@ $repdoc->add_posting( $num, 1 ); $repdoc->add_value(0, $num); $write->replace_document_by_term($term, $repdoc); -$write->flush(); +$write->commit(); my $doc = $write->get_document(1); is($write->get_doccount(), 1, "check document count"); @@ -155,7 +155,7 @@ for my $num (qw(one two three four five)) { $doc->add_value(0, $num); $write->add_document( $doc ); } -$write->flush(); +$write->commit(); $doccount = $write->get_doccount(); is($doccount, 6, "check number of documents in WritableDatabase"); @@ -166,7 +166,7 @@ my $lastdocterm = $write->get_document($lastdocid)->get_value(0); ok($write->term_exists($lastdocterm), "check term exists"); $write->delete_document($lastdocid); -$write->flush(); +$write->commit(); is($write->get_doccount(), $doccount - 1, "check number of documents in WritableDatabase"); ok(!$write->term_exists($lastdocterm), "check term exists"); @@ -177,7 +177,7 @@ ok($write->term_exists($delterm), 'check term exists before deleting a document' is($write->get_termfreq($delterm), 1, 'check term frequency before deleting a document'); $write->delete_document_by_term($delterm); -$write->flush(); +$write->commit(); is($write->get_doccount(), $doccount - 2, 'check WritableDatabase after deleting a document'); ok(!$write->term_exists($delterm), 'check term exists after deleting a document'); @@ -189,7 +189,7 @@ ok($write->term_exists($delterm), 'check term exists of documents which has term is($write->get_termfreq($delterm), $doccount - 2, 'check term frequency of term "test"'); $write->delete_document_by_term($delterm); -$write->flush(); +$write->commit(); is($write->get_doccount(), 0, 'check WritableDatabase after deleting all documents'); ok(!$write->term_exists($delterm), 'check term exists after deleting all documents'); diff --git a/xapian-bindings/python/pythontest.py b/xapian-bindings/python/pythontest.py index 3bcf274f9..2c127767f 100644 --- a/xapian-bindings/python/pythontest.py +++ b/xapian-bindings/python/pythontest.py @@ -1497,7 +1497,7 @@ def test_compactor(): db1.set_metadata('key', '1') db1.set_metadata('key1', '1') db1.add_document(doc1) - db1.flush() + db1.commit() db2 = xapian.WritableDatabase(db2path, xapian.DB_CREATE_OR_OVERWRITE) doc2 = xapian.Document() @@ -1507,7 +1507,7 @@ def test_compactor(): db2.set_metadata('key', '2') db2.set_metadata('key2', '2') db2.add_document(doc2) - db2.flush() + db2.commit() # Compact with the default compactor # Metadata conflicts are resolved by picking the first value diff --git a/xapian-bindings/python3/pythontest.py b/xapian-bindings/python3/pythontest.py index 1588f55ee..8614f0b71 100644 --- a/xapian-bindings/python3/pythontest.py +++ b/xapian-bindings/python3/pythontest.py @@ -1490,7 +1490,7 @@ def test_compactor(): db1.set_metadata('key', '1') db1.set_metadata('key1', '1') db1.add_document(doc1) - db1.flush() + db1.commit() db2 = xapian.WritableDatabase(db2path, xapian.DB_CREATE_OR_OVERWRITE) doc2 = xapian.Document() @@ -1500,7 +1500,7 @@ def test_compactor(): db2.set_metadata('key', '2') db2.set_metadata('key2', '2') db2.add_document(doc2) - db2.flush() + db2.commit() # Compact with the default compactor # Metadata conflicts are resolved by picking the first value diff --git a/xapian-bindings/ruby/smoketest.rb b/xapian-bindings/ruby/smoketest.rb index 7c3f965de..ed47d0b27 100644 --- a/xapian-bindings/ruby/smoketest.rb +++ b/xapian-bindings/ruby/smoketest.rb @@ -263,7 +263,7 @@ class XapianSmoketest < Test::Unit::TestCase db1.set_metadata('key', '1') db1.set_metadata('key1', '1') db1.add_document(doc1) - db1.flush() + db1.commit() db2 = Xapian::WritableDatabase.new(db2path, Xapian::DB_CREATE_OR_OVERWRITE) doc2 = Xapian::Document.new() @@ -273,7 +273,7 @@ class XapianSmoketest < Test::Unit::TestCase db2.set_metadata('key', '2') db2.set_metadata('key2', '2') db2.add_document(doc2) - db2.flush() + db2.commit() # Compact with the default compactor # Metadata conflicts are resolved by picking the first value -- 2.11.4.GIT