Re: TS: Limited cover density ranking - Mailing list pgsql-hackers

From karavelov@mail.bg
Subject Re: TS: Limited cover density ranking
Date
Msg-id 3c8f10c1e2ffb295f4013e020723249f.mailbg@mail.bg
Whole thread Raw
In response to TS: Limited cover density ranking  (karavelov@mail.bg)
List pgsql-hackers
----- Цитат от Oleg Bartunov (oleg@sai.msu.su), на 28.01.2012 в 21:04 ----- <br /><br />> I suggest you work on more
generalapproach, see <br />> http://www.sai.msu.su/~megera/wiki/2009-08-12 for example. <br />> <br />> btw, I
don'tlike you changed ts_rank_cd arguments. <br /><br />Hello Oleg, <br /><br />Thanks for the feedback. <br /><br />Is
itOK to begin with adding an exta argument and check in calc_rank_cd? <br /><br />I could change the function names in
ordernot to overload ts_rank_cd <br />arguments. My proposition is : <br /><br />at sql level: <br
/>ts_rank_lcd([weights],tsvector, tsquery, limit, [method]) <br /><br />at C level: <br />ts_ranklcd_wttlf <br
/>ts_ranklcd_wttl<br />ts_ranklcd_ttlf <br />ts_ranklcd_ttl <br /><br />Adding the functions could be done as an
extensionbut they are just <br />trampolines into calc_rank_cd(). <br /><br />I agree that what you describe in the
wikipage is more general approach. So this : <br /><br />SELECT ts_rank_lcd(to_tsvector('a b c'),
to_tsquery('a&c'),2)>0; <br /><br />could be replaced with <br /><br />SELECT to_tsvector('a b c') @@
to_tsquery('(a?2 c)|(c ?2 a) '); <br /><br />but if we need to look for 3 or more nearby terms without order the
tsquery<br />with '?' operator will became quite complicated. For example <br /><br />SELECT tsvec @@ <br />'(a ? b ?
c)| (a ? c ? b) | (b ? a ? c) | (b ? c ? a) | (c ? a ? b) | (c ? b ? a)'::tsquery; <br /><br />is the same as <br /><br
/>SELECTts_rank_lcd(tsvec, 'a&b&c'::tsquery,2)>0; <br /><br />So this is the reason to think that the
generalapproach does not exclude the the <br />usefulness of the approach that I am proposing. <br /><br />Best regards
<br/><br />-- <br />Luben Karavelov <br /> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dumpall and temp_tablespaces dependency problem
Next
From: Dean Rasheed
Date:
Subject: Index-only scan performance regression