Re: exposing more parse was: Re: tsearch2: setting weights on tsquery - Mailing list pgsql-general

From Tom Lane
Subject Re: exposing more parse was: Re: tsearch2: setting weights on tsquery
Date
Msg-id 27925.1224610833@sss.pgh.pa.us
Whole thread Raw
In response to Re: exposing more parse was: Re: tsearch2: setting weights on tsquery  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses tsearch2: setting weights on tsquery plainto_tsquery with | or and weight  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> I missed it. Thanks. Nearly perfect. Now I've to understand what a
> {} is.
> An array with a null element? an empty array? an array containing ''?

Hmm ... it appears that ts_lexize is returning a one-dimensional array of
no elements, whereas '{}'::text[] returns a zero-dimensional array;
as does array[]::text[] so you can't easily get around it :-(

We probably ought to clean this up...

In the meantime it looks like you could check for
"array_upper(lexemes,1) > 0".

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Varchar vs varchar(64)
Next
From: Ivan Sergio Borgonovo
Date:
Subject: tsearch2: setting weights on tsquery plainto_tsquery with | or and weight