Re: to_tsvector() with hyphens
От | Tom Lane |
---|---|
Тема | Re: to_tsvector() with hyphens |
Дата | |
Msg-id | 29462.1436200562@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | to_tsvector() with hyphens (Brian DeRocher <brian@derocher.org>) |
Список | pgsql-general |
Brian DeRocher <brian@derocher.org> writes: > But why does to_tsquery() AND them? > rasmas_hackathon=> select * from to_tsquery( 'gn-foo | bandage' ); > to_tsquery > ------------------------------------ > 'gn-foo' & 'gn' & 'foo' | 'bandag' > (1 row) Because what you're looking for is gn-foo, not either gn alone or foo alone. Converting to "OR" would be the wrong thing. > The rank is so bad. > rasmas_hackathon=> select ts_rank_cd( to_tsvector( 'gn series bandage' ), to_tsquery( 'gn-foo | bandage' ) ); > ts_rank_cd > ------------ > 0.1 > (1 row) > Without the hyphen the rank is better, despite the process above. > rasmas_hackathon=> select ts_rank_cd( to_tsvector( 'gn series bandage' ), to_tsquery( 'gn | bandage' ) ); > ts_rank_cd > ------------ > 0.2 > (1 row) Don't see the problem. The first case doesn't match the query as well as the second one does, so I'd fully expect a higher rank for the second. regards, tom lane
В списке pgsql-general по дате отправления: