daniel <dochtorek@gmail.com> 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