unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Joel Reicher <joel.reicher@gmail.com>
Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Any package for boolean search?
Date: Sat, 28 Dec 2024 19:20:38 +0300	[thread overview]
Message-ID: <Z3AlVgThZY8yeJk1@lco2> (raw)
In-Reply-To: <868qrzaj1l.fsf@gmail.com>

* Joel Reicher <joel.reicher@gmail.com> [2024-12-28 19:08]:
> Solving a search query is an eval, but I think you are saying you want to
> avoid code injection which is fair enough.

Search query is just a string I receive so parsing the string for OR
will be my first development.

> Off the top of my head you can map over the sexpr returned by read and
> rewrite the symbols to ones you control before evaling.

I understand that approach, and I understand there would be way to
allow only some symbols, though I assure you that reading the sexp is
not needed. Generally I do a lot of evals in my documents. I find the
feature fantastic. I am using it for template interpolation.

RCD Template Interpolation System for Emacs:
https://hyperscope.link/3/7/1/3/3/RCD-Template-Interpolation-System-for-Emacs.html

Though for website search it will be string parsing on chunks of
different types of queries.

> In my opinion it is still worth avoiding a parse, which is what Lisp can
> give you.

1. First stage of development

   - treat it as exact, collect IDs
   - allow 1-2 Levenshtein difference, 
      -- Function: string-distance string1 string2 &optional bytecompare
     This function returns the “Levenshtein distance” between the source
     string STRING1 and the target string STRING2.  The Levenshtein

   - get 5-10 pages where both or more words of the query, which are
     not stop words, appear apart from each other, unless user quoted
     the query

2. Second stage

   - recognize if there is any OR

-- 
Jean Louis



  reply	other threads:[~2024-12-28 16:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-25 10:01 Any package for boolean search? Jean Louis
2024-12-25 16:21 ` [External] : " Drew Adams
2024-12-26  0:15   ` Jean Louis
2024-12-26  6:02 ` Joel Reicher
2024-12-26 10:58   ` Jean Louis
2024-12-26 23:14     ` Joel Reicher
2024-12-27 11:05       ` Jean Louis
2024-12-28  3:44         ` Joel Reicher
2024-12-28 13:43           ` Jean Louis
2024-12-28 16:06             ` Joel Reicher
2024-12-28 16:20               ` Jean Louis [this message]
2024-12-26 11:00   ` Jean Louis

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=Z3AlVgThZY8yeJk1@lco2 \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=joel.reicher@gmail.com \
    /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).