[GENERAL] Tsearch2 ranking
2 rows of tsvector: 'bar':2 'baz':3 'foo':1 'bar':2 'baz':1 'foo':3 so source text was: foo bar baz baz bar foo ts_query now is 'foobazbaz', so both matched. How can I honor the correct order of the first row and rank it higher? The position information is there, why doesn't rank() / rank_cd() not use it? Is there any way to make a difference between those to rows? Any? Even if it's a bad hack? I really need it :/ Thanks in advance -- Regards, Hannes Dorbath ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] Tsearch2 ranking
ts_query now is 'foobarbaz' Sorry, typo. On 13.03.2006 12:38, Hannes Dorbath wrote: ts_query now is 'foobazbaz', so both matched. -- Regards, Hannes Dorbath ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [GENERAL] Tsearch2 ranking
On Mon, 13 Mar 2006, Hannes Dorbath wrote: 2 rows of tsvector: 'bar':2 'baz':3 'foo':1 'bar':2 'baz':1 'foo':3 so source text was: foo bar baz baz bar foo ts_query now is 'foobazbaz', so both matched. How can I honor the correct order of the first row and rank it higher? The position information is there, why doesn't rank() / rank_cd() not use it? There is a hint to do this. See Phrase search in http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_Notes Is there any way to make a difference between those to rows? Any? Even if it's a bad hack? I really need it :/ Thanks in advance Regards, Oleg _ Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru), Sternberg Astronomical Institute, Moscow University, Russia Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(495)939-16-83, +007(495)939-23-83 ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [GENERAL] Tsearch2 ranking
Order of terms in ts_query hasn't any meaning in current implementation. But you can use your own ranking function. Hannes Dorbath wrote: 2 rows of tsvector: 'bar':2 'baz':3 'foo':1 'bar':2 'baz':1 'foo':3 so source text was: foo bar baz baz bar foo ts_query now is 'foobazbaz', so both matched. How can I honor the correct order of the first row and rank it higher? The position information is there, why doesn't rank() / rank_cd() not use it? Is there any way to make a difference between those to rows? Any? Even if it's a bad hack? I really need it :/ Thanks in advance -- Teodor Sigaev E-mail: [EMAIL PROTECTED] WWW: http://www.sigaev.ru/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings