On 2023-11-02 14:27, Eric Wong wrote:
> David Wei <[email protected]> wrote:
>> Hi,
>>
>> I have a problem with lei dfn filters. Here is my query:
>>
>> lei q -o ~/Mail/overlay -I https://lore.kernel.org/all -t '(dfn:net/* OR 
>> dfn:drivers/net/ethernet/mellanox/mlx5/* OR 
>> dfn:drivers/net/ethernet/broadcom/bnxt/*) AND tc:[email protected] AND 
>> rt:2.week.ago..'
>>
>> I'm seeing patches that touch drivers/net/* whereas I only want to match
>> net/*.
>>
>> I tried changing it to dfn:^net/* and dfn:b/net/* but neither is
>> working,
> 
> Right, ^ is a regexp thing and I don't think Xapian supports anything
> like it.
> 
>> I also read the Xapian docs: https://xapian.org/docs/queryparser.html
>> but didn't see anything more than * wildcards.
>>
>> Could you please advise on how I can limit my query to only net/*?
> 
> I'm not an expert in Xapian's parser, either, but I think `AND NOT'
> is appropriate here.  So something like:
> 
>       dfn:net/* AND NOT dfn:drivers/net/*
> 
> Would be helpful to know if it works for you.
> (having NOT only is very expensive and not allowed via the web interface,
> but combining it a positive match should be fine)

Thank you, using AND NOT does work. However, there are many more file
paths that partially match "net/", and excluding each one by one using
AND NOT is tedious.

I found that using b:b/net/* works very well to match patch diffs in
message bodies. This achieves my intended goal of matching only ^net/*.

Reply via email to