This patch introduces new interface method of GIN which takes same arguments as consistent but returns float8. float8 gin_ordering(bool check[], StrategyNumber n, Datum query, int32 nkeys, Pointer extra_data[], bool *recheck, Datum queryKeys[], bool nullFlags[], Datum addInfo[], bool addInfoIsNull[])
This patch implements gingettuple method which can return ordering data using KNN infrastructure. Also it introduces >< operator for fts which support ordering in GIN index. Some example:
postgres=# explain analyze select * from dblp_titles2 where tsvector @@ to_tsquery('english', 'statistics') order by tsvector >< to_tsquery('english', 'statistics') limit 10;