Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwsuQ-00ErQU-6G for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Oct 2023 23:40:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qwsuO-005n81-NR for pgsql-bugs@arkaria.postgresql.org; Sat, 28 Oct 2023 23:40:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwsuO-005n7t-Eo for pgsql-bugs@lists.postgresql.org; Sat, 28 Oct 2023 23:40:00 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qwsuL-002nXb-H4 for pgsql-bugs@lists.postgresql.org; Sat, 28 Oct 2023 23:39:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=iqV34ZPnBusM4mLUMi52LmsqSz0imhOlIuSgEof+LIc=; b=ZL9zt S+IPiygjC5Qf8ZAnRRozNDjOmBGRvc7KLxkqZg3FqfCvttth/rKNfBG2LJxTRv912P9wIaf1hRPC8 nKq6pi6c0UesYwLZ2gnV1c1drPGQPcaBXe20na7xLbxRQJ4Sm7MWm+uikRRnGBnW3d1l8cVDZjRpl gRXengFneFhhpzK737lI3BLYegu46MIFx7KXDT3mI0vJ4Tc5gLkomPDnDUPiywpKkRlLyQ3GUYAa0 fvVit3WP+NSpBnB0gg2nC1s8tQTxSn5uVHeF2FSNx4Ug/946KfHc/WGEzaRAdC9qgQWFj3k/GqCdA C/sBwd9z8t9G5B4s4nzx53RYiwmpw==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qwsuK-009XPH-1L; Sat, 28 Oct 2023 19:39:56 -0400 Date: Sat, 28 Oct 2023 19:39:56 -0400 From: Bruce Momjian To: Pavel Borisov Cc: Tom Lane , Alex Malek , pgsql-bugs@lists.postgresql.org, ngigi@at.co.ke Subject: Re: BUG #15172: Postgresql ts_headline with <-> operator does not highlight text properly Message-ID: References: <152461454026.19805.6310947081647212894@wrigleys.postgresql.org> <1995601.1698526000@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Oct 29, 2023 at 01:20:11AM +0400, Pavel Borisov wrote: > Hi, Bruce and Tom! > I think that the ts_headline main functionality is to make Postgres > more friendly to search-engine-like approach, which I feel is too > niche usage scenario for supporting it as a part of core code. If > remember right, bug reports coming from the users supposing it has > more strict semantics than it has in reality are regular. And I also > remember myself being puzzled by unusual output in the past. > > If we fiddle with other parameters of ts_headline we can easily have > other kinds of output that seem counterintuitive e.g.: > SELECT ts_headline('English', I just posted a proposed doc patch which should help reduce the number of people surprised by the highlighting. Let's see if that helps. FYI, here is a Stack Overflow post from 2021 linking to the original email that started this thread from 2018: https://stackoverflow.com/questions/69512416/is-ts-headline-intended-to-highlight-non-matching-parts-of-the-query-which-it -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.