From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams <drew.adams@oracle.com> Newsgroups: gmane.emacs.help Subject: RE: Relevance search in Emacs Date: Sat, 5 Dec 2020 13:43:12 -0800 (PST) Message-ID: <f8099ea7-05b4-4487-b8db-02b0d3405142@default> References: <courier.000000005FCBCEDF.00007E34@static.rcdrun.com> <2bd19b32-1806-44ed-9c50-fe60bca90965@default> <X8v69AAK+WaGhIAr@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38535"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs <help-gnu-emacs@gnu.org> To: Jean Louis <bugs@gnu.support> Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 05 22:43:42 2020 Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org> Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>) id 1klfLC-0009up-7d for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 22:43:42 +0100 Original-Received: from localhost ([::1]:58116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org>) id 1klfLB-00014J-6W for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 16:43:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <drew.adams@oracle.com>) id 1klfKp-00013z-T8 for help-gnu-emacs@gnu.org; Sat, 05 Dec 2020 16:43:19 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:39298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <drew.adams@oracle.com>) id 1klfKn-0001Dc-Pk for help-gnu-emacs@gnu.org; Sat, 05 Dec 2020 16:43:19 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B5LdxB3070680; Sat, 5 Dec 2020 21:43:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=W7GBwe6udzKIBQaKsBoIAW9+q6HbIT1IrQsIpzHd+w0=; b=oJdFHC44RR+rwddrJilxYmlXk2mZNuJISa8CMP51xWWBkHrXr3Yk771oZT4tHKhCHXth VZEaDH5eRxxjxOQ2Se1DmhlY4jyHTdWQltQeeOmML0T+QcAfeK+48rCileMlC3xfmi6L thhcfhDb1CQJ9FFV61FcXLIPoeDgHx3w4t2mGyuxg1vQhR+Jdd7HuijyHvG4zagHvGe9 SlErYDuLEAojlW0rww+AbGyy+zZ2t7QVF9eVQ70kbsstC4Z7iuBmv6O0tnVVQlTS9QYf 0ISRlICR36o6eY+ZcUQHPNq4e1A0rbjwNKCKAaMYFRBxhy7p6GQN/7WRSdtfdFKYYqpl 3Q== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 35825ksbv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 05 Dec 2020 21:43:16 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B5LeYFB002634; Sat, 5 Dec 2020 21:43:15 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 3581hh54ds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 05 Dec 2020 21:43:15 +0000 Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0B5LhEML024207; Sat, 5 Dec 2020 21:43:14 GMT In-Reply-To: <X8v69AAK+WaGhIAr@protected.rcdrun.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5071.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9826 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012050147 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9826 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 clxscore=1015 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012050147 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/help-gnu-emacs> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org> Xref: news.gmane.io gmane.emacs.help:126049 Archived-At: <http://permalink.gmane.org/gmane.emacs.help/126049> > > https://www.postgresql.org/docs/current/textsearch-intro.html*TEXTSEARC= H-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". >=20 > 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. >=20 > 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. >=20 > 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 =E2=80=93 within a given number of characters, words, lists, or sentences (you can add to this list of distance units, using option =E2=80=98isearchp-movement-unit-alist=E2=80=99). 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 =E2=80=98cat=E2=80=99 or near =E2=80=98dog= =E2=80=99. 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 =E2=80=98cat=E2=80=99 and not near =E2=80=98dog= =E2=80=99. 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.