From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS202172 91.218.175.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id DAEEE1F406 for ; Sun, 12 Nov 2023 08:24:04 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=grimler.se header.i=@grimler.se header.a=rsa-sha256 header.s=key1 header.b=N4AbObof; dkim-atps=neutral Date: Sun, 12 Nov 2023 09:23:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=grimler.se; s=key1; t=1699777441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3H6uZKWKRianHZwPtXrcCUzXgdkqMufzPoLiajk6Irc=; b=N4AbObofmSGVHlQFqiT4KPfTjwcA/y6pgBRp34xqFSpc3OkwfEqwb/oohOzsQ+0Ope5Tde Hyx01vh3CpUDaiWtUxFoOVSBWoufOHlfxEh8eULixX0rrRr5OzPFa2k4DCMc3ZCTe5gX8j PDZSW/fwWAj8hVt/5ETI6oNgDiSzxSE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Henrik Grimler To: Eric Wong Cc: meta@public-inbox.org Subject: Re: [Bug] lei: extra quotes inserted into query with AND/OR Message-ID: <20231112082356.GA3149@grimlerstat.localdomain> References: <20231111224411.GA620644@grimlerstat.localdomain> <20231112001050.M917867@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231112001050.M917867@dcvr> X-Migadu-Flow: FLOW_OUT List-Id: Hi Eric, On Sun, Nov 12, 2023 at 12:10:50AM +0000, Eric Wong wrote: > Henrik Grimler wrote: > > Hi, > > > > I recently found out about lei and installed it through archlinux's > > package manager and am trying out queries. When using AND/OR extra > > quotes are inserted in the curl command which messes it up, for > > example: > > > > $ lei q -I https://lore.kernel.org/all/ -o ~/mail/foo 'dfn:COPYING OR dfn:Makefile' > > # /home/grimler/.local/share/lei/store 0/0 > > # /usr/bin/curl -Sf -s -d '' https://lore.kernel.org/all/?x=m&q=dfn%3A%22COPYING+OR+dfn%3AMakefile%22 > > # 0 written to /home/grimler/mail/foo/ (0 matches) > > > > where it can be seen that it tries to search for 'dfn:"COPYING OR > > dfn:Makefile"', and no hits are returned since there is no file named > > "COPYING OR dfn:Makefile". > > Don't use quotes unless you want a phrase search. The quotes are added by lei (or some dependency) when query contains space. Happens also if I search for a single file: lei q -I https://lore.kernel.org/all/ -o ~/mail/foo ' dfn:COPYING' which results in this curl cmd: /usr/bin/curl -Sf -s -d '' https://lore.kernel.org/all/?x=m&q=+dfn%3A%22COPYING%22 where %22 then is " Without spaces in the query all is well: lei q -I https://lore.kernel.org/all/ -o ~/mail/foo 'dfn:COPYING' which gives expected results /usr/bin/curl -Sf -s -d '' https://lore.kernel.org/all/?x=m&q=dfn%3ACOPYING So, maybe there is an issue in some perl dependency on archlinux, any suggestion where I should start digging? Best regards, Henrik Grimler > Basically, I wanted the CLI and WWW search to feel the same. > > > Is this a known issue, or am I doing something wrong? > > I think you're the second user to add unnecessary quotes; > is it learned behavior from another search tool? > > In my experience, generic web search engines don't use quotes > outside of phrase search, either... > > My primary mail experience is from using mairix, so lei borrows > heavily from it. But IIRC, mairix doesn't support phrase search. > > Anyways, thanks for the note and any future comments you provide :>