From: | cen <imbacen(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Full text search randomly not working for short prefixes? |
Date: | 2016-12-02 15:49:12 |
Message-ID: | 9e849f3a-8f8e-f2c7-50f2-57f27c0d34b9@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks, that makes sense. I think I'll go with the cast approach, I
don't really need stemming anywhere.
Tom Lane je 02. 12. 2016 ob 16:33 napisal:
> cen <imbacen(at)gmail(dot)com> writes:
>> Something funny going on with my full text search.. and I have no idea what.
> The way to debug this sort of thing is generally to look at what tsquery
> you're actually getting. I get
>
> regression=# select to_tsquery(unaccent('a:*'));
> NOTICE: text-search query contains only stop words or doesn't contain lexemes, ignored
> to_tsquery
> ------------
>
> (1 row)
>
> regression=# select to_tsquery(unaccent('an:*'));
> NOTICE: text-search query contains only stop words or doesn't contain lexemes, ignored
> to_tsquery
> ------------
>
> (1 row)
>
> regression=# select to_tsquery(unaccent('ana:*'));
> to_tsquery
> ------------
> 'ana':*
> (1 row)
>
> Of course, only the last is going to match 'ana'.
>
> So you need to use a text search configuration in which a/an are
> not stop words. Or possibly you could cast the unaccent result
> directly to tsquery rather than passing it through to_tsquery(),
> though likely that would just have a different set of failure modes
> with queries where you do wish stemming would occur.
>
> The problem with "no" seems to be the same.
>
> regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Joseph Krogh | 2016-12-02 17:05:59 | Re: Full text search randomly not working for short prefixes? |
Previous Message | otar shavadze | 2016-12-02 15:35:03 | Re: ARRAY_LENGTH() function behavior with empty array |