Re: Proof of concept for counting messages in thread

2023-02-18 Thread Michael J Gruber
Am Di., 14. Feb. 2023 um 02:47 Uhr schrieb David Bremner : > > Michael J Gruber writes: > > > That is really weird: > > ``` > > xapian-delve -t G00021229 . > > Posting List for term 'G00021229' (termfreq 115, collfreq 0, > > wdf_max 0): 146259 ... > > ``` > > with 115 record

[PATCH 5/6] WIP/test: (count ...) tests

2023-02-18 Thread David Bremner
The most interesting case is probably tags with a small number of uses, since these could be typos or similar errors. --- test/T083-sexpr-count.sh | 8 1 file changed, 8 insertions(+) diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh index 858aa8bf..1be3f62d 100755 ---

[PATCH 4/6] WIP/test: pathname related tests

2023-02-18 Thread David Bremner
--- test/T083-sexpr-count.sh | 21 + 1 file changed, 21 insertions(+) diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh index f3010d11..858aa8bf 100755 --- a/test/T083-sexpr-count.sh +++ b/test/T083-sexpr-count.sh @@ -112,4 +112,25 @@ notmuch@notmuchmail.org

[PATCH 2/6] WIP/lib: support count modifier in sexp queries

2023-02-18 Thread David Bremner
In this initial commit, support all term based fields, but only document/test the thread size feature. --- lib/parse-sexp.cc| 65 ++-- test/T083-sexpr-count.sh | 30 +++ 2 files changed, 79 insertions(+), 16 deletions(-) create mode

[PATCH 3/6] WIP/test: (count ...) tests for to / from

2023-02-18 Thread David Bremner
--- test/T083-sexpr-count.sh | 85 1 file changed, 85 insertions(+) diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh index e825ef3d..f3010d11 100755 --- a/test/T083-sexpr-count.sh +++ b/test/T083-sexpr-count.sh @@ -27,4 +27,89 @@ cat

[PATCH 6/6] WIP/tests: (count ...) tests for subject

2023-02-18 Thread David Bremner
--- test/T083-sexpr-count.sh | 8 1 file changed, 8 insertions(+) diff --git a/test/T083-sexpr-count.sh b/test/T083-sexpr-count.sh index 1be3f62d..b1c0a3ac 100755 --- a/test/T083-sexpr-count.sh +++ b/test/T083-sexpr-count.sh @@ -141,4 +141,12 @@ test_begin_subtest "no tag is used less

WIP: add a (count ...) modifier for sexp-queries

2023-02-18 Thread David Bremner
This updates and obsoletes the series at [1]. The backend that constructs queries is unmodified from that series, but the parser now allows the use of count modifier in several more places. Basically there is not much more code to maintain to do it for any field based on terms (notably not date),

[PATCH 1/6] WIP/lib: add count query backend

2023-02-18 Thread David Bremner
--- lib/Makefile.local | 3 +- lib/count-query.cc | 62 ++ lib/database-private.h | 6 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 lib/count-query.cc diff --git a/lib/Makefile.local b/lib/Makefile.local index