unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@mit.edu>
To: Michal Sojka <sojkam1@fel.cvut.cz>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 3.5/8] Query parser tests for wildcard queries.
Date: Sun, 23 Jan 2011 17:02:43 -0500	[thread overview]
Message-ID: <AANLkTi==CxAUVvtO6nbFo_XPWmGo4u1MLH8LcQuquyAE@mail.gmail.com> (raw)
In-Reply-To: <87pqrosx6e.fsf@steelpick.2x.cz>

[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]

Oops, yes.  I'm not sure why you had to initialize qparser_desc (are you
sure it doesn't compile if you omit that?), but a change in the later patch
5/8 requires the extra argument to _notmuch_qparser_add_db_prefix.  I've got
another patch with tests for patch 5/8 that adds and tests the argument that
I'll send out shortly (along with tests for the remaining patches).

Glad to see you're taking advantage of the query parser!

On Sat, Jan 22, 2011 at 11:47 AM, Michal Sojka <sojkam1@fel.cvut.cz> wrote:

> On Fri, 21 Jan 2011, Austin Clements wrote:
> > Since wildcard queries require a database, qparser-test can now open a
> > database.
>
> Hi Austin,
>
> I had to apply the following changes in order to be able to compile the
> tests (make test).
>
> I'm going to test the parser in my daily use, but so far it looks really
> nice. I especially enjoy the before and after searches. Thanks.
>
> -Michal
>
> diff --git a/test/qparser-test.cc b/test/qparser-test.cc
> index 18318aa..5be6220 100644
> --- a/test/qparser-test.cc
> +++ b/test/qparser-test.cc
> @@ -61,7 +61,7 @@ test_one (void *ctx, const char *query_str)
>     void *local = talloc_new (ctx);
>     Xapian::Query q;
>     _notmuch_token_t *toks, *root;
> -    char *error, *qparser_desc, *xqparser_desc;
> +    char *error, *qparser_desc = NULL, *xqparser_desc;
>
>     toks = _notmuch_qparser_lex (local, qparser, query_str);
>     printf("[lex]    %s\n", _notmuch_token_show_list (local, toks));
> @@ -100,9 +100,9 @@ static _notmuch_qparser_t *
>  create_qparser (void *ctx)
>  {
>      _notmuch_qparser_t *qparser = _notmuch_qparser_create (ctx, notmuch);
> -    _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE);
> -    _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE);
> -    _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE);
> +    _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE, FALSE);
> +    _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE, FALSE);
> +    _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE, FALSE);
>     return qparser;
>  }
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>

[-- Attachment #2: Type: text/html, Size: 3060 bytes --]

  reply	other threads:[~2011-01-23 22:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-16  8:10 [RFC PATCH v2 0/8] Custom query parser, date search, folder search, and more Austin Clements
2011-01-16  8:10 ` [PATCH 1/8] Implement a custom query parser with a mostly Xapian-compatible grammar Austin Clements
2011-01-21  6:37   ` [PATCH 1.5/8] Query parser testing framework and basic tests Austin Clements
2011-01-16  8:10 ` [PATCH 2/8] Parse NEAR and ADJ operators Austin Clements
2011-01-21  6:39   ` [PATCH 2.5/8] Query parser tests for " Austin Clements
2011-01-16  8:10 ` [PATCH 3/8] Parse wildcard queries Austin Clements
2011-01-21  6:40   ` [PATCH 3.5/8] Query parser tests for " Austin Clements
2011-01-22 16:47     ` Michal Sojka
2011-01-23 22:02       ` Austin Clements [this message]
2011-01-24 12:24         ` Michal Sojka
2011-01-16  8:10 ` [PATCH 4/8] Replace Xapian query parser with custom query parser Austin Clements
2011-01-16  8:10 ` [PATCH 5/8] Support "tag:*" as well as "NOT tag:*" queries Austin Clements
2011-01-24 17:15   ` [PATCH 5.5/8] test: Wildcard tag search and untagged search Austin Clements
2011-01-16  8:10 ` [PATCH 6/8] Support maildir folder search Austin Clements
2011-01-24 17:13   ` [PATCH 6/8 v2] " Austin Clements
2011-01-24 17:18   ` [PATCH 6.5/8] test: Add tests for custom query parser-based folder searches Austin Clements
2011-01-16  8:10 ` [PATCH 7/8] Implement value range queries Austin Clements
2011-01-16  8:10 ` [PATCH 8/8] Support before: and after: date search with sane date syntax Austin Clements
2011-01-24 17:20   ` [PATCH 8.5/8] test: Add tests for search by date Austin Clements
2011-01-31  4:33 ` [PATCH 9/8] qparser: Delete (and thus close) the Xapian database Austin Clements
2011-02-02  5:03 ` [RFC PATCH v2 0/8] Custom query parser, date search, folder search, and more Austin Clements
2011-02-02 22:48   ` Carl Worth
2011-02-03  6:14     ` Folder search semantics (was Re: [RFC PATCH v2 0/8] Custom query parser, date search, folder search, and more) Austin Clements
2011-02-20 19:52       ` Folder search semantics Rob Browning
2011-02-20 20:00         ` Rob Browning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi==CxAUVvtO6nbFo_XPWmGo4u1MLH8LcQuquyAE@mail.gmail.com' \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=sojkam1@fel.cvut.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).