unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Henrik Grimler <henrik@grimler.se>
To: Eric Wong <e@80x24.org>
Cc: meta@public-inbox.org
Subject: Re: [Bug] lei: extra quotes inserted into query with AND/OR
Date: Sun, 12 Nov 2023 09:23:56 +0100	[thread overview]
Message-ID: <20231112082356.GA3149@grimlerstat.localdomain> (raw)
In-Reply-To: <20231112001050.M917867@dcvr>

Hi Eric,

On Sun, Nov 12, 2023 at 12:10:50AM +0000, Eric Wong wrote:
> Henrik Grimler <henrik@grimler.se> 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 :>

  reply	other threads:[~2023-11-12  8:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-11 22:44 [Bug] lei: extra quotes inserted into query with AND/OR Henrik Grimler
2023-11-12  0:10 ` Eric Wong
2023-11-12  8:23   ` Henrik Grimler [this message]
2023-11-12  9:02     ` Eric Wong
2023-11-12 11:59       ` Henrik Grimler
2023-11-12 13:24         ` Eric Wong

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://public-inbox.org/README

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

  git send-email \
    --in-reply-to=20231112082356.GA3149@grimlerstat.localdomain \
    --to=henrik@grimler.se \
    --cc=e@80x24.org \
    --cc=meta@public-inbox.org \
    /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.
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).