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: Thu, 26 Dec 2024 13:58:54 +0300	[thread overview]
Message-ID: <Z2027mroprLfIZKh@lco2> (raw)
In-Reply-To: <86a5cjdlrv.fsf@gmail.com>

* Joel Reicher <joel.reicher@gmail.com> [2024-12-26 09:03]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > Boolean Search: This is a method where search terms are combined using
> > boolean logic, as described by the operators AND, OR, and NOT.
> > 
> > I would like to implement this classic into the website search. And I
> > wish to keep it simple.
> 
> Is there an Emacs or elisp aspect to this question I might be
> missing?

I don't know what you mean. I am looking for some ready package that
provides maybe string searching within other strings, by using boolean
operators.

I am starting the logic here below:

(defun wrs-search-query-process (query)
  (let ((query (wrs-search-clean-query query)))
    (cond
     ;; dispatch if there is no boolean
     ((not (string-match-p (rx word-start (or "OR" "NOT" "AND" word-end)) query))
      (wrs-search-query query))
     
     ;; dispatch when there is AND but not OR or NOT
     ((and (string-match-p (rx word-start "AND" word-end) query)
	   (not (string-match-p (rx word-start (or "OR" "NOT" word-end)) query)))
      (wrs-search-query-and query)))))

So there will be different ways how to process those parts of the
query separated by AND, OR, NOT and in various combinations.

> Are you after a package to submit a search to a particular search
> engine? Is that what you mean?

No. 

It is website search, when user enters some terms to get list of
website pages. I don't have many, but 1300+ in single website has some
key information for people.

-- 
Jean Louis



  reply	other threads:[~2024-12-26 10:58 UTC|newest]

Thread overview: 7+ 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 [this message]
2024-12-26 23:14     ` Joel Reicher
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=Z2027mroprLfIZKh@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).