Search Postgresql Archives

Re: ts_headline and query with hyphen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



daniel <dochtorek@xxxxxxxxx> writes:
> I have a question about ts_headline, when the query includes word like 
> 'on-line' - only the 'line' part is highlighted, even though the whole 
> phrase is indexed too, some details below.

Part of the reason is that "on" is a stop word (at least in the default
english dictionary).  That's why you get

> select to_tsquery('play & on-line');
>           to_tsquery
> ----------------------------
>   'play' & 'on-lin' & 'line'

and not "'play' & 'on-lin' & 'on' & 'line'".  If you did get the latter
then you'd get a headline result with both parts highlighted, similar to
your "custom-built" case.

> But maybe ts_headline understands or operates on 
> single, not hyphenated words only?

Dunno.  It would seem reasonable to highlight the whole compound in
these cases, but I have no idea how hard that is.

Another thing that seems a bit odd here is that we seem to be stemming
the compound word as a whole, but not the individual parts.  Not sure
how sane that combination of choices is ...

			regards, tom lane


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux