Using Xapian synonyms with notmuch

classic Classic list List threaded Threaded
3 messages Options
Xu Wang Xu Wang
Reply | Threaded
Open this post in threaded view
|

Using Xapian synonyms with notmuch

I have some contacts who go by several names (mostly people who use
their native name in addition to sometimes using a name easier to
pronounce for others; but also some secret agents). I often want to do
something like "from:James" and where notmuch gives me back results
with emails from "James", "Jimmy" and from "Jaime".

I have done searching and found some relevant threads:

https://notmuchmail.org/pipermail/notmuch/2013/015571.html
https://xapian.org/docs/synonyms.html
https://getting-started-with-xapian.readthedocs.io/en/latest/howtos/synonyms.html

However, they are very technical for me. It is not possible to just
put something in .notmuch-config that specifies synonyms so that
notmuch will build the Xapian database with those aliases?

By the way, I don't know Xapian at all or how to call it manually. I
have very simple .notmuch-config and I don't have any deep
understanding or programming experience.

Kind regards,

Xu
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Using Xapian synonyms with notmuch

Xu Wang <[hidden email]> writes:

> I have some contacts who go by several names (mostly people who use
> their native name in addition to sometimes using a name easier to
> pronounce for others; but also some secret agents). I often want to do
> something like "from:James" and where notmuch gives me back results
> with emails from "James", "Jimmy" and from "Jaime".
>

I think the only solution that is possible with current notmuch is to
use a stored query

$ notmuch config set query.james "from:James or from:Jimmy or from Jaime"
$ notmuch search query:james and date:today

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Using Xapian synonyms with notmuch

Xu Wang <[hidden email]> writes:

>
> xu:$ notmuch config set query.james "from:james or from:jimmy or from:jaime"
> xu:$ notmuch search "from:james" | wc -l
> 79
> xu:$ notmuch search "from:james or from:jimmy or from:jaime" | wc -l
> 91
> xu:$ notmuch search james | wc -l
> 177
>
> I was hoping above quantities would be the same, so I think I did
> something wrong.

That's not how saved queries work. You need to search for "query:james"
not "from:james".
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch