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
Post a Comment