Re: [GENERAL] Use full text to rank results higher if they are "closer hit"
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [GENERAL] Use full text to rank results higher if they are "closer hit" |
| Дата | |
| Msg-id | 11992.1487088246@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [GENERAL] Use full text to rank results higher if they are "closer hit" (Thomas Nyberg <tomuxiong@gmx.com>) |
| Ответы |
Re: [GENERAL] Use full text to rank results higher if they are"closer hit"
|
| Список | pgsql-general |
Thomas Nyberg <tomuxiong@gmx.com> writes:
> Here both 'hello' and 'hello world' are ranked equally highly when
> searching with 'hello'. What I'm wondering is, is there a way within
> postgres to have it match higher to just 'hello' than 'hello world'?
> I.e. something like it slightly down-weights extraneous terms? Of course
> in general I don't know the query or the field strings ahead of time.
Read the documentation for ts_rank --- there's a normalization option
for that.
I'd also suggest you might prefer using ts_rank_cd, which is supposed to
penalize cases where the matching words aren't close together.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера