Обсуждение: best strategy for searching large text fields

Поиск
Список
Период
Сортировка

best strategy for searching large text fields

От
"Campbell, Lance"
Дата:

PostgreSQL 9.3.x

I am looking for really good documentation on how to do the following.

 

Use Case

I have a web application that will be storing into a table large blocks of HTML web content.  Users will then want to search these fields for phrases.  What is the best strategy for handling this in PostgreSQL? 

 

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…

 

 

 

 

Thanks,

 

Lance Campbell

Software Architect

Web Services at Public Affairs

217-333-0382

University of Illinois at Urbana-Champaign logo

 

 

Re: best strategy for searching large text fields

От
Julien Cigar
Дата:
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.
>
> Use Case
> I have a web application that will be storing into a table large blocks of HTML web content.  Users will then want to
searchthese fields for phrases.  What is the best strategy for handling this in PostgreSQL? 
>
> 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...
>

FTS is the way to go:
http://www.postgresql.org/docs/9.3/static/textsearch-intro.html

>
>
>
> Thanks,
>
> Lance Campbell<http://illinois.edu/person/lance>
> Software Architect
> Web Services at Public Affairs
> 217-333-0382
> [University of Illinois at Urbana-Champaign logo]<http://illinois.edu/>
>
>



--
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.