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

Search ranking order #1

Open
belst opened this issue Apr 11, 2018 · 0 comments
Open

Search ranking order #1

belst opened this issue Apr 11, 2018 · 0 comments

Comments

@belst
Copy link
Contributor

belst commented Apr 11, 2018

tags := array of tags of model (videos, playlists)
query := array of tags of searchquery

find:

SELECT * FROM model_table WHERE tags && query;

&& = overlap operator.

ordering:

need: union and intersection cardinality functions. (here: card_intersect(arr1, arr2) and card_union(arr1, arr2))

ORDER BY card_intersect(arr1, arr2) / card_union(arr1, arr2) DESC;

union must not be empty (just drop empty search queries.)

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

No branches or pull requests

1 participant