@arueegg: "Hi,
Is it possible to get all the positions of a lexeme in a result-set of a
query? For example, we have the table
TEXT                                                   TEXT_IDX
'TSearch2 is very cool'                                ...
'It would be much cooler with lexeme positions'
Our query is
SELECT text, position FROM thetable WHERE  text_idx @@ 'cool'888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4tsquery;
                          ^^^^^^^^
The result should be something like:
'TSearch2 is very cool', 4
'It would be much cooler with lexeme positions', 5
If not, is there a function that returns the positions of a lexeme in a
single entry?
thanks
Alex
Dipl.-Inform. Alexander Rueegg
Bioinformatics Department   Faculty of Technology
Bielefeld University
Phone: 2499182732
Fax:   2499182732
Room:  C02-206
Email: <email_address>
-(end of broadcast)-
TIP 1: subscribe and unsubscribe commands go to <email_address>"
    @teodor: "<quote>
You can write such function, but why do you need it? May be there is more simple 
way to resolve your problem?
BTW, lexeme can have more that one position...
Teodor Sigaev                                  E-mail: <email_address>
-(end of broadcast)-
TIP 8: explain analyze is your friend"
    @arueegg: "Thank you for your response.
We want to know the distance or sequence of words in a set of
text-entries. So first we try to retrieve the text-entries in which the
words appear using tsearch indexing. After that we want to calculate the
positions of the words in each entry, e.g. parsing the index column of
the retrieved text-entries.
Maybe there exists a function or an easier/cheaper way to get this
information (and which considers that the words maybe occur more than once).
thanks,
Alex
<quote>
Alexander Rueegg
Email: <email_address>
-(end of broadcast)-
TIP 6: Have you searched our list archives?
               <url>"
    @teodor: "<quote>
No, it is not exists. The easiest way is to extract this info from tsvector value.
Teodor Sigaev                                  E-mail: <email_address>
-(end of broadcast)-
TIP 5: Have you checked our extensive FAQ?
               <url>"
{'source': 'USENET', 'other_information': '{"reply_count": 3, "forum_name": "comp.databases.postgresql.general.20140617.mbox"}', 'file': 'data/output/usenet-comp.databases.parquet'}