Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XkDx6-0001Rb-U3 for pgsql-sql@arkaria.postgresql.org; Fri, 31 Oct 2014 15:17:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XkDx6-0003Ve-ET for pgsql-sql@arkaria.postgresql.org; Fri, 31 Oct 2014 15:17:24 +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 1XkDx5-0003VY-Js for pgsql-sql@postgresql.org; Fri, 31 Oct 2014 15:17:23 +0000 Received: from relaygateway01.edpnet.net ([212.71.1.210]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XkDx1-0004io-LB for pgsql-sql@postgresql.org; Fri, 31 Oct 2014 15:17:21 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgSAEKnU1TV25Oz/2dsb2JhbABZAw6DAFRYgwaKer8eCodNAoEVFwEBAQEBfYQDAQEEIzMjEAsYCRMOAgIPBSUkHIg8CbVvjxaFYwEBAQEBAQQBAQEBAQEBG5EAEAcRgiVBEiSBHgWWYocVAYFtlFuDOEE8LwEBgkkBAQE X-IPAS-Result: AlgSAEKnU1TV25Oz/2dsb2JhbABZAw6DAFRYgwaKer8eCodNAoEVFwEBAQEBfYQDAQEEIzMjEAsYCRMOAgIPBSUkHIg8CbVvjxaFYwEBAQEBAQQBAQEBAQEBG5EAEAcRgiVBEiSBHgWWYocVAYFtlFuDOEE8LwEBgkkBAQE X-IronPort-AV: E=Sophos;i="5.07,295,1413237600"; d="scan'208";a="282720997" Received: from 213.219.147.179.adsl.dyn.edpnet.net (HELO mordor.lan) ([213.219.147.179]) by relaygateway01.edpnet.net with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Oct 2014 15:42:57 +0100 Date: Fri, 31 Oct 2014 16:17:10 +0100 From: Julien Cigar To: "Campbell, Lance" Cc: "pgsql-sql@postgresql.org" Subject: Re: best strategy for searching large text fields Message-ID: <20141031151710.GD8131@mordor.lan> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/3yNEOqWowh/8j+e" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.9 (-) 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 --/3yNEOqWowh/8j+e Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 31, 2014 at 02:59:48PM +0000, Campbell, Lance wrote: > PostgreSQL 9.3.x > I am looking for really good documentation on how to do the following. >=20 > Use Case > I have a web application that will be storing into a table large blocks o= f HTML web content. Users will then want to search these fields for phrase= s. What is the best strategy for handling this in PostgreSQL? >=20 > What would the SQL look like? > What data type should the web content field be in the table? > Is there a way to set up the SQL so that matches are best match to least = accurate match? > Etc... >=20 FTS is the way to go: http://www.postgresql.org/docs/9.3/static/textsearch-intro.html >=20 >=20 >=20 > Thanks, >=20 > Lance Campbell > Software Architect > Web Services at Public Affairs > 217-333-0382 > [University of Illinois at Urbana-Champaign logo] >=20 >=20 --=20 Julien Cigar Belgian Biodiversity Platform (http://www.biodiversity.be) PGP fingerprint: EEF9 F697 4B68 D275 7B11 6A25 B2BB 3710 A204 23C0 No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. --/3yNEOqWowh/8j+e Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJUU6f2AAoJEAi2KiTKQR5p5C8P+gJhCWPNRgZi++vfzAZOfPuS gWqcLqX1XdC5rUEjZIZshj0DcjIXPig5kxLZgFgR1+DtaUNECnsqQU8PQkhElPW2 M8HLWmsER1fESwTFJBFs9/W+utCdT+VcI5fbjqlVHpU16geZ3cre2k2mFmTf9a/u arUoQfFFn0LhwhcAGldkyg2qzMhb0SnSd461VogvAliI8R3M113C85BCYRLSdz0u kP/7oC5FsbDC8Y3nau9knjwtyL3l/meoQR8GxtG8HbCgD5hfdzo69l4YVXeaSnVh Ujn5K7qnXghO59RHaPZofCkc7MZdHLyfp4SIfQsADdNq1hlGbWzMr8UW8iSF+z+R kthCIPtvAkNl5d99GpGP7qTcyfjfFfqWD3SbbT2jRGwpEI7wEjRPj3dI3al/kT1Q RzZcogRtezqmn+UgiuR4Rd2qz2ZYs4VezNh3maChtUIw8al6UT60rrW2yBspldUr F3UtWTI2pZisNu6ez/R8QjwXnl6O5U85MkldoaA0lEJhQ+R08B1WPc771G4rJE0D oHotEKKEls4lQiocpG+AQRBrS35yW1OEhJfnE2dY6szWxo32l3vMxHhbQtMCIcpw zLdUIJH3pUPIk11f7DtCkiaYxZ5joR67KNHykgLf8FLY0vHlLnrkooguI/0i3S6X 9myRhS4MJKxk1zTKvOQb =T/g2 -----END PGP SIGNATURE----- --/3yNEOqWowh/8j+e--