help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Relevance search in Emacs


From: Drew Adams
Subject: RE: Relevance search in Emacs
Date: Sat, 5 Dec 2020 13:43:12 -0800 (PST)

> > https://www.postgresql.org/docs/current/textsearch-intro.html*TEXTSEARCH-MATCHING
> >
> > That's apparently what's often called full-text search,
> > and which is an indexed search.  The text is indexed
> > ahead of time, and the index is used for search "lookup".
> 
> I am not using indexed method, just searching on the fly.

I see.  I figured it was full-text search because PostGres is
a database.

> Relevance search could be simpler in Emacs just for strings.

It can be anything you want it to be.

> > "Relevance" can mean anything.  Think of how much can go
> > into, say, a google search: "relevance" there can include
> > intimate detail about you as a person, your likes, etc.
> 
> What I mean is that words are closer to each other, for example
> that term: google intimate person
> find your above quoted paragraph.

IOW, nearness measures.  That's typically used with indexed
text.  No, AFAIK, vanilla Emacs has no such thing.  And it
doesn't have any relevance sorting, except possibly for
recency of use.

> > Yes, some Emacs 3rd-party libraries do provide "scoring"
> > of some kinds of searches.  For example, for certain kinds
> > of fuzzy matching a score can indicate how "closely" a
> > given candidate is matched by your search pattern.
> 
> Fuzzy matching could be good. Is there in Emacs similar? Not that I am
> looking for outside libraries.

Not in vanilla Emacs.  Well, I guess maybe they've recently
added some pseudo-fuzzy matching as a completion style.
But you can easily add your own as a completion style, for
any Emacs version.

3rd-party libraries have fuzzy matching.

Isearch+ gives you the ability to use nearness matching,
using dynamic filtering:

https://www.emacswiki.org/emacs/DynamicIsearchFiltering

>From that page:

  Search for something that is near something else – within
  a given number of characters, words, lists, or sentences
  (you can add to this list of distance units, using option
  ‘isearchp-movement-unit-alist’). You specify the nearness.
  You can also constrain the nearby pattern to be only before
  or only after the search hit.

  Search for stuff in the union of given contexts. Example:
  search for text that is near ‘cat’ or near ‘dog’.

  Search for stuff outside contexts: Use the complement of
  any set of contexts as the search space. Example: search
  for text that is not near ‘cat’ and not near ‘dog’.

You can do anything you want, from just vanilla Emacs, as you
know.  You can also look to the code or design of 3rd-party
features for help or inspiration.  Free software means you
have the source.  You can, but you need not, reinvent your
own wheels.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]