? at beginning of prefixed field
Olly Betts
olly at survex.com
Fri Mar 13 00:27:10 GMT 2026
On Fri, Mar 13, 2026 at 09:02:44AM +0900, David Bremner wrote:
> On the other hand if I put the ? at the front of the word,
> it seems like the query parser is failing and falling back
> to an unprefixed search
>
> % NOTMUCH_DEBUG_QUERY=t ./notmuch count 'to:?remner'
> Query string is:
> to:?remner
> Exclude query is:
> Query((((Kspam OR Kdeleted) OR Kmuted) OR Kbad-address))
> Final query is:
> Query(((Tmail AND ((Zto at 1 OR ZGto at 1 OR ZKto at 1 OR ZQto at 1 OR ZPto at 1 OR ZXPROPERTYto at 1 OR ZXFOLDER:to at 1 OR ZXFROMto at 1 OR ZXTOto at 1 OR ZXATTACHMENTto at 1 OR ZXMIMETYPEto at 1 OR ZXSUBJECTto at 1 OR ZXUList:to at 1) AND (WILDCARD OR ?remner SYNONYM WILDCARD OR G?remner SYNONYM WILDCARD OR K?remner SYNONYM WILDCARD OR Q?remner SYNONYM WILDCARD OR P?remner SYNONYM WILDCARD OR XPROPERTY?remner SYNONYM WILDCARD OR XFOLDER:?remner SYNONYM WILDCARD OR XFROM?remner SYNONYM WILDCARD OR XTO?remner SYNONYM WILDCARD OR XATTACHMENT?remner SYNONYM WILDCARD OR XMIMETYPE?remner SYNONYM WILDCARD OR XSUBJECT?remner SYNONYM WILDCARD OR XUList:?remner))) AND_NOT (((Kspam OR Kdeleted) OR Kmuted) OR Kbad-address)))
> 157728
Curiously I don't see the same thing as you. For me the prefix isn't
applied when a wildcard is at the start (which is a bug):
$ xapian-quest -f default,wildcard_glob -pto:XTO 'to:b?emner'
Parsed Query: Query(WILDCARD SYNONYM XTOb?emner)
No database specified so not running the query.
$ xapian-quest -f default,wildcard_glob -pto:XTO 'to:?remner'
Parsed Query: Query(WILDCARD SYNONYM ?remner)
No database specified so not running the query.
$ xapian-quest -f default,wildcard_glob -pto:XTO 'to:*remner'
Parsed Query: Query(WILDCARD SYNONYM *remner)
No database specified so not running the query.
Cheers,
Olly
More information about the Xapian-discuss
mailing list