RE: Full text search with more than one word - Mailing list pgsql-general

From Ritanjali Majihee
Subject RE: Full text search with more than one word
Date
Msg-id 000d01d4b4a4$a1fb3c60$e5f1b520$@247headhunting.com
Whole thread Raw
In response to Re: Full text search with more than one word  (Magnus Hagander <magnus@hagander.net>)
List pgsql-general

Hi Magnus ,

 

Example- Search keyword is ("Marketing Coordinator" OR "Marketing Specialist" OR "Marketing Associate" ) AND "Creative Suite".

 

Thank you for your information , phraseto_tsquery() is supporting two word search or phase search where as it is not supporting logical operator search and to_tsquery() is supporting logical operator search but not supporting two word search or phase search. If we need both functionally  in full text search is there any other way we can proceed .

 

Can you please help us solve this issue.

 

Thanks,

Ritanjali

 

 

From: magnus@hagander.net [mailto:magnus@hagander.net]
Sent: Friday, January 18, 2019 8:45 PM
To: Ritanjali Majihee
Cc: pgsql-general General; Ambiger, Mahantesh; mahantesh.ambiger@yahoo.com
Subject: Re: Full text search with more than one word

 

(please don't top-post on the postgresql mailinglists)

 

On Fri, Jan 18, 2019 at 3:57 PM Ritanjali Majihee <rmajhee@247headhunting.com> wrote:

Hi Magnus,

 

exact  Search keyword is ("Marketing Coordinator" OR "Marketing Specialist" OR "Marketing Associate" ) AND "Creative Suite".

 

Where condition like below syntax we are using in Postgresql function

 

SELECT * from tablename where html_tokens  @@ to_tsquery( ' || quote_literal(ikeyword) || ')

 

From search keyword we are getting result but not as expected .It is not searching together "Marketing Coordinator" string, It is giving  result like "Marketing and Coordinator".

Can you please help us solve this issue.

 

 

You should look into phraseto_tsquery() for searching for phrases, and websearchto_tsquery() for the kind of complete search with or and and in it that you are looking for. to_tsquery doesn't do any parsing like that.

 

//Magnus

 

pgsql-general by date:

Previous
From: Andrew Smith
Date:
Subject: Re: Sv: Re: Geographical multi-master replication
Next
From: Magnus Hagander
Date:
Subject: Re: Full text search with more than one word