Full Text fuzzy search

Started by Michael Vodepover 19 years ago5 messagesgeneral
Jump to latest
#1Michael Vodep
mvodep@gmx.net

Hi

How can i do a full text fuzzy search with PgSQL?

For example: i got a text domain. I search for Postgresql
He should return a result for 'Postgresql' if i enter following values:
PostgreSQL, Postgresql, postgresql
but also
bostgresql, posdgresql, bosdgresql

Is this possible?

Regrads
michael

#2Teodor Sigaev
teodor@sigaev.ru
In reply to: Michael Vodep (#1)
Re: Full Text fuzzy search

Play around contrib/tsearch2 and contrib/pg_trgm

Michael Vodep wrote:

Hi

How can i do a full text fuzzy search with PgSQL?

For example: i got a text domain. I search for Postgresql
He should return a result for 'Postgresql' if i enter following values:
PostgreSQL, Postgresql, postgresql
but also
bostgresql, posdgresql, bosdgresql

Is this possible?

Regrads
michael

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/

#3Najib Abi Fadel
nabifadel@yahoo.com
In reply to: Michael Vodep (#1)
Re: Full Text fuzzy search

for PostgreSQL, Postgresql, postgresql u can use ilike:
example: select * from table where name ilike 'postgresql'
U can even try:
select * from table where name ilike '%postgresql%'
the '%' is for any set of caracters (like * when u are doing a shell commande)

For the others (bostgresql, posdgresql, bosdgresql) i think u should write a function, that's what we did in our application.

HTH

Najib.
Michael Vodep <mvodep@gmx.net> wrote: Hi

How can i do a full text fuzzy search with PgSQL?

For example: i got a text domain. I search for Postgresql
He should return a result for 'Postgresql' if i enter following values:
PostgreSQL, Postgresql, postgresql
but also
bostgresql, posdgresql, bosdgresql

Is this possible?

Regrads
michael

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

---------------------------------
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.

#4Teodor Sigaev
teodor@sigaev.ru
In reply to: Najib Abi Fadel (#3)
Re: Full Text fuzzy search

For the others (bostgresql, posdgresql, bosdgresql) i think u should
write a function, that's what we did in our application.

contrib/pg_trgm solves it

--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/

#5Michael Vodep
mvodep@gmx.net
In reply to: Teodor Sigaev (#4)
Re: Full Text fuzzy search

Thanks for the replies,

And all the functions work with levenstein and soundex? Can they also
return the percentage of similarity?

Regards
michael