Closed awh-tokyo closed 6 years ago
It should be worked in the future version.
You can use it with PGroonga 2.0.7:
CREATE TABLE memos (
content text
);
CREATE INDEX pgroonga_content_index
ON memos
USING pgroonga (content)
WITH (tokenizer='TokenNgram("report_source_location", true)');
SELECT pgroonga_highlight_html('one two three four five',
ARRAY['two three', 'five'],
'pgroonga_content_index');
-- pgroonga_highlight_html
-- -----------------------------------------------------------------------------------
-- one<span class="keyword"> two three</span> four<span class="keyword"> five</span>
-- (1 row)
See also: https://pgroonga.github.io/reference/functions/pgroonga-highlight-html.html
It seems like pgroonga_highlight_html doesn't support a phrase search:
outputs