Re: postgresql & Fulltext & ranking & my own functions - Mailing list pgsql-general

From Oleg Bartunov
Subject Re: postgresql & Fulltext & ranking & my own functions
Date
Msg-id CAF4Au4zgnm7yk+raHVATCoKOgosREJpZZbC4LVs6K8F9i5wAPQ@mail.gmail.com
Whole thread Raw
In response to postgresql & Fulltext & ranking & my own functions  (Nicolas Paris <niparisco@gmail.com>)
Responses Re: postgresql & Fulltext & ranking & my own functions
List pgsql-general


On Tue, May 3, 2016 at 3:21 PM, Nicolas Paris <niparisco@gmail.com> wrote:
Hello,

Documentation says : (http://www.postgresql.org/docs/9.5/static/textsearch-controls.html#TEXTSEARCH-RANKING)
"The built-in ranking functions are only examples. You can write your own ranking functions and/or combine their results with additional factors to fit your specific needs."

The build-in seems not enough for my use case. How to write my own ranking functions ?

I would like to create something like  ts_rank_cd( tsv, 'foo & bar', my_new_normalization_integer)


you can look on src/backend/utils/adt/tsrank.c and write your own function. google can help https://www.google.ru/search?q=how+to+write+c+function+postgresql
 
----
pg 9.5

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Vacuum full of parent without partitions possible?
Next
From: Adrian Klaver
Date:
Subject: Re: Field size become unlimited in union...