Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XlNwC-00065Y-EQ for pgsql-sql@arkaria.postgresql.org; Mon, 03 Nov 2014 20:09:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XlNwB-0008At-Dt for pgsql-sql@arkaria.postgresql.org; Mon, 03 Nov 2014 20:09:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XlNwA-0008An-OY for pgsql-sql@postgresql.org; Mon, 03 Nov 2014 20:09:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XlNw7-0006S6-0c for pgsql-sql@postgresql.org; Mon, 03 Nov 2014 20:09:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sA3K91ft025578; Mon, 3 Nov 2014 15:09:01 -0500 From: Tom Lane To: "Campbell, Lance" cc: "pgsql-sql@postgresql.org" Subject: Re: Text searching HTML In-reply-to: References: Comments: In-reply-to "Campbell, Lance" message dated "Mon, 03 Nov 2014 17:15:58 +0000" Date: Mon, 03 Nov 2014 15:09:01 -0500 Message-ID: <25577.1415045341@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org "Campbell, Lance" writes: > Is there a preferred way to search text within an HTML document? I have been reading up on searching via to_tsvector. You can pass the to_tsvector two parameters. The first appears to be a dictionary and the second text. Is there by chance an English HTML dictionary? That way html tags or html attributes would be ignored. I believe all the built-in text search configurations ignore HTML tags by default, since they have no mapping for the "tag" token type that the built-in parser reports those as. You could of course make a custom configuration that acts differently. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql