Re: TS: Limited cover density ranking
От | karavelov@mail.bg |
---|---|
Тема | Re: TS: Limited cover density ranking |
Дата | |
Msg-id | 9232c5812ff1325dc1eed8cab89e26e3.mailbg@mail.bg обсуждение исходный текст |
Ответ на | TS: Limited cover density ranking (karavelov@mail.bg) |
Список | pgsql-hackers |
----- Цитат от karavelov@mail.bg, на 27.01.2012 в 18:48 ----- <br /><br />> ----- Цитат от Sushant Sinha (sushant354@gmail.com),на 27.01.2012 в 18:32 ----- <br />> <br />>> The rank counts 1/coversize. So bigger coverswill not have much impact <br />>> anyway. What is the need of the patch? <br />>> <br />>> -Sushant.<br />>> <br />> <br />> If you want to find only combinations of words that are close one to another,with the patch you could use something as: <br />> <br />> WITH a AS (SELECT to_tsvector('a b c d e g h i jk') AS vec, to_tsquery('a&d') AS query) <br />> SELECT * FROM a WHERE vec @@ query AND ts_rank_cd(3,vec,query)>0;<br />> <br /><br />Another example, if you want to match 'b c d' only, you could use: <br/><br />WITH A AS (SELECT to_tsvector('a b c d e g h i j k') AS vec, to_tsquery('b&c&d') AS query) <br />SELECT* FROM A WHERE vec @@ query AND ts_rank_cd(2,vec,query)>0; <br /><br />The catch is that it will match also 'bd c', 'd c b', 'd b c', 'c d b' and 'd b d', so it is not a <br />replacement for exact phrase match but something thatI find useful <br /><br />-- <br />Luben Karavelov
В списке pgsql-hackers по дате отправления: