Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQLjM-00050r-DS for pgsql-general@arkaria.postgresql.org; Fri, 10 Feb 2023 05:13:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pQLjL-00020v-A4 for pgsql-general@arkaria.postgresql.org; Fri, 10 Feb 2023 05:13:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQLjK-00020m-Vv for pgsql-general@lists.postgresql.org; Fri, 10 Feb 2023 05:13:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQLjI-0006GR-U5 for pgsql-general@lists.postgresql.org; Fri, 10 Feb 2023 05:13:50 +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 31A5DkTb4016891; Fri, 10 Feb 2023 00:13:47 -0500 From: Tom Lane To: Chris cc: pgsql-general@lists.postgresql.org Subject: Re: pg_trgm vs. Solr ngram In-reply-to: <4628c3f6-e2c5-1484-71cf-62446cec984d@networkz.ch> References: <4628c3f6-e2c5-1484-71cf-62446cec984d@networkz.ch> Comments: In-reply-to Chris message dated "Fri, 10 Feb 2023 03:20:36 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4016889.1676006026.1@sss.pgh.pa.us> Date: Fri, 10 Feb 2023 00:13:46 -0500 Message-ID: <4016890.1676006026@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Chris writes: > Or maybe hacking my own pg_trgm wouldn't be so hard and could be fun, do > I pretty much just need to change the emitted tokens or will this lead > to significant complications in the operators, indexes etc.? See KEEPONLYALNUM in pg_trgm/trgm.h ... Now, using a custom-modified pg_trgm module in production is likely not something you want to do for long. It might be interesting to look into whether the relatively-recently-invented "operator class parameter" mechanism could be exploited to allow this behavior to be customized without hacking C code. regards, tom lane