mysql - Finding words that are close together with PostgreSQL -


is there way find words appear close postgresql. know mysql supports innodb tables when using proximity search.

example:

select quote "too far apart"  quotes match(quote) against ('"early wise" @20' in boolean mode); 

ts_rank_cd provides different value depending on how far apart terms are.

select     ts_rank_cd(          to_tsvector('simple', 'the quick brown fox'),          plainto_tsquery('simple', 'the fox')      ) first,     ts_rank_cd(          to_tsvector('simple', 'the quick brown fox'),          plainto_tsquery('simple', 'quick brown')      ) second; 

output:

first       second 0.0333333   0.1 

0.1 / ts_rank_cd seems give actual distance between words


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -