pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: alex@hill.net.au
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8354: stripped positions can generate nonzero rank in ts_rank_cd
Date: Fri, 31 Jan 2014 16:22:51 -0500
Message-ID: <20140131212251.GQ19957@momjian.us> (raw)
In-Reply-To: <E1V59Oo-0007mB-GA@wrigleys.postgresql.org>
References: <E1V59Oo-0007mB-GA@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>


Would someone please comment on this text search bug report?  Thanks.

---------------------------------------------------------------------------

On Fri, Aug  2, 2013 at 07:03:42AM +0000, alex@hill.net.au wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      8354
> Logged by:          Alex Hill
> Email address:      alex@hill.net.au
> PostgreSQL version: 9.2.4
> Operating system:   OS X 10.8.4 Mountain Lion
> Description:        
> 
> Hi all,
> 
> 
> The docs for ts_rank_cd state:
> 
> 
> "This function requires positional information in its input. Therefore it
> will not work on "stripped" tsvector values — it will always return zero."
> 
> 
> However if a tsvector contains some stripped lexemes and some non-stripped,
> ts_rank_cd will rank extents including the non-stripped values.
> 
> 
> For example, this evaluates to zero as expected:
> 
> 
>     SELECT ts_rank_cd(strip(to_tsvector('text search')),
> plainto_tsquery('text search'))
> 
> 
> 
> 
> But this doesn't:
> 
> 
>     SELECT ts_rank_cd(to_tsvector('text') || strip(to_tsvector('search')),
> plainto_tsquery('text search'))
> 
> 
> 
> 
> I think this is a bug, if not in the code then in the documentation, which
> isn't clear on what happens when stripped and positioned lexemes are mixed
> in one tsvector.
> 
> 
> I would prefer that stripped lexemes were completely ignored by ts_rank_cd:
> my use case is using this as a fifth pseudo-weight, which matches a @@ query
> but doesn't add to a ts_rank_cd ranking.
> 
> 
> What do you think?
> 
> 
> Cheers,
> Alex
> 
> 
> 
> -- 
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (12+ messages)  latest in thread

Message-ID: <20140131212251.GQ19957@momjian.us>
Permalink:  ../20140131212251.GQ19957@momjian.us/
Also on:    postgresql.org/message-id/20140131212251.GQ19957@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, alex@hill.net.au
  Subject: Re: BUG #8354: stripped positions can generate nonzero rank in ts_rank_cd
  In-Reply-To: <20140131212251.GQ19957@momjian.us>
  References: <E1V59Oo-0007mB-GA@wrigleys.postgresql.org> <20140131212251.GQ19957@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox