How to get char indices from text parser | tsvector?

From: Roman Gurinovich <roman(dot)gurinovich(at)xpansa(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to get char indices from text parser | tsvector?
Date: 2020-03-29 12:57:06
Message-ID: CAOn+SnPL-MVJ4-yZYr_DT7KtOiZB8kdQ8F49GqA6Oc2h4MDoQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

is there any possibility to get char "coordinates", not only token
"coordinates" from tsvector or, basically, text parser? Like in
Elasticsearch

GET _analyze?text=This fox is brown&analyzer=english
{
"tokens": [
{
"token": "fox",
"start_offset": 5,
"end_offset": 8,
"type": "",
"position": 1
}

while in PostgreSQL

SELECT to_tsvector('This fox is brown')
'brown':4 'fox':2 'is':3 'this':1

--

Best Regards,
Roman Gurinovich

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-03-29 17:49:17 Re: could not determine encoding for locale "et_EE.UTF-8": codeset is "CPUTF-8" in pg_restore
Previous Message Andrus 2020-03-29 12:35:39 Hot standby from Debian to Windows