user373201
user373201

Reputation: 11435

postgres text search

We have a search feature that allows users to search based on product description. The table could countain around 2m rows. Do i need to implement full text search for this or do I just need a regular index on the description col.

question 2. is there a tool that will generate 2m records.

Thanks in advance.

Upvotes: 1

Views: 1531

Answers (2)

user330315
user330315

Reputation:

I agree with Frank: you will not get far without full-text search. A "regular index" will not help at all because any "user-friendly" search needs to do partial matching (LIKE '%somevalue%') and this will never use an index

For generating test data, I have good experience with Benerator. It's a bit complicated to learn, but very powerful.

Alternatively you can use Datagenerator which is actually an Oracle tool, but can produce flat files as well that can be used with Postgres

Upvotes: 2

Frank Heikens
Frank Heikens

Reputation: 127086

When a "regular index" is a B-Tree-index, than this will not help in the search. You need FTS to search for content in a piece of text.

http://www.postgresql.org/docs/current/interactive/textsearch.html

Upvotes: 1

Related Questions