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 1r55vL-00BlLo-MP for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Nov 2023 15:10:55 +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 1r55vJ-008tDp-Sg for pgsql-bugs@arkaria.postgresql.org; Mon, 20 Nov 2023 15:10:53 +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 1r55vJ-008tDg-KX for pgsql-bugs@lists.postgresql.org; Mon, 20 Nov 2023 15:10:53 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r55vC-006Ug6-U7 for pgsql-bugs@lists.postgresql.org; Mon, 20 Nov 2023 15:10:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3AKFAiUc1316295; Mon, 20 Nov 2023 10:10:44 -0500 From: Tom Lane To: oliverfwales@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18208: ts_headline MinWords and MaxWords cannot be set to the same value In-reply-to: <18208-c695b6b402c37727@postgresql.org> References: <18208-c695b6b402c37727@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 20 Nov 2023 14:04:26 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1316293.1700493044.1@sss.pgh.pa.us> Date: Mon, 20 Nov 2023 10:10:44 -0500 Message-ID: <1316294.1700493044@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Setting MaxWords and MinWords to the same value (e.g. 30) in the options of > ts_headline throws the error "MinWords should be less than MaxWords". Is > there any reason why they must be different? Why not allow setting them to > the same value to allow a fixed number of words to be returned? [ shrug... ] I'd turn that around: why would that be a good idea? Usually, you want quite a bit of room between MinWords and MaxWords to allow a more-or-less-apropos text snippet to be returned. It seems highly unlikely that the calling query knows enough about the right snippet length (in advance of knowing the match) to get good results by demanding an exact length. regards, tom lane