1

I have already created the full text search index in MS SQL Server.

Below is the query which I have written. I am new to Postgres so, I am trying to recreate the same thing in Postgres.

So, how can I create the same thing in postgres.

CREATE FULLTEXT INDEX ON [dbo].['example_tab'] test1,test2... KEY INDEX unique_index
          WITH STOPLIST = SYSTEM
2

1 Answer 1

1

Full text search is nothing normed by a standard, so you can expect that it works differently in different database systems.

To speed up a full text search query like

SELECT * FROM atab
WHERE to_tsvector('english', textcol) @@ to_tsquery('english', 'search string');

you would create this index:

CREATE INDEX ON atab USING gin (to_tsvector('english', textcol));
Sign up to request clarification or add additional context in comments.

2 Comments

how to create index for multiple columns like sql server
You can use the concatenation operator || on tsvectors and index the result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.