Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weights? #12

Closed
jimfulton opened this issue Feb 28, 2017 · 4 comments
Closed

Weights? #12

jimfulton opened this issue Feb 28, 2017 · 4 comments
Labels

Comments

@jimfulton
Copy link

ts_rank and ts_rank_cd let you supply weights for text from different sources (A, B, C, and D).

How does RUM handle text from different sources? Does it treat the sources as the same? Does it use built-in weights? Or is there a way to supply weights?

@za-arthur
Copy link
Contributor

RUM has different operator for ranking <=>. For example:

SELECT t, a <=> to_tsquery('english', 'beautiful | place') AS rank
    FROM test_rum
    WHERE a @@ to_tsquery('english', 'beautiful | place')
    ORDER BY a <=> to_tsquery('english', 'beautiful | place');
                t                |   rank
---------------------------------+-----------
 The situation is most beautiful | 0.0303964
 It is a beautiful               | 0.0303964
 It looks like a beautiful place | 0.0607927
(3 rows)

This operator uses same sources: A, B, C, and D. It has default weights: {0.1, 0.2, 0.4, 1.0}; same as ts_rank and ts_rank_cd. But in current version of RUM you cant supply custom weights.

But you can use ts_rank and ts_rank_cd functions too. But they will be slower than <=>.
Do you have any error with this functions?

@jimfulton
Copy link
Author

No, I don't have an error, I was just wondering if/how weights are used. You answered my question. Thanks.

@jimfulton
Copy link
Author

Oh, I didn't try ts_rank/ts_rank_cd because the reason I'm using RUM is to get the faster ranking.

@za-arthur
Copy link
Contributor

Yes! They definitely will be slower than RUM's ranking operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants