From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Relevance search in Emacs Date: Sun, 6 Dec 2020 00:26:12 +0300 Message-ID: References: <2bd19b32-1806-44ed-9c50-fe60bca90965@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15097"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Help GNU Emacs To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 05 22:28:36 2020 Return-path: 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 ) id 1klf6Z-0003oS-O2 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 22:28:35 +0100 Original-Received: from localhost ([::1]:49824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klf6Y-000543-Na for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 05 Dec 2020 16:28:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klf6D-00053p-MI for help-gnu-emacs@gnu.org; Sat, 05 Dec 2020 16:28:13 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:45297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klf6B-0004Kp-HQ for help-gnu-emacs@gnu.org; Sat, 05 Dec 2020 16:28:13 -0500 Original-Received: from localhost ([::ffff:197.157.0.57]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0007.000000005FCBFB68.0000168A; Sat, 05 Dec 2020 21:28:07 +0000 Content-Disposition: inline In-Reply-To: <2bd19b32-1806-44ed-9c50-fe60bca90965@default> Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126043 Archived-At: * Drew Adams [2020-12-06 00:07]: > > Chapter 12. Full Text Search > > 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. Relevance search could be simpler in Emacs just for strings. This is example of an SQL query that gives results on the fly without previous index and it searches only within hyperlink names and tags, it is easy to add the body or text to it. It does not change visible speed. (format "SELECT DISTINCT hlinks_id, hlinks_name, hlinktypes_name, actionstatuses_name FROM hlinks, hlinktypes, actionstatuses WHERE (actionstatuses_id = hlinks_actionstatuses AND hlinks_hlinktypes = hlinktypes_id) AND to_tsquery(%s) @@ to_tsvector(hlinks_name || ' ' || hlinks_tags) %s" query parent) > > What is good is that database PostgreSQL offers built-in relevance > > searches.. In the manual there is little I can find related to > > "relevance". > > Which manual? Emacs manual. I have been expecting something similar in completing-read or some other functions. > > If somebody knows if there is some "relevance" search in Emacs built-in > > packages let me know, otherwise I will let database do the job. > > "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. > 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.