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

Fix tag search order and not to use tsvector #3611

Merged
merged 1 commit into from Jun 6, 2017

Conversation

@unarist
Copy link
Collaborator

commented Jun 6, 2017

  • Sort results by the name (fixes #3591)
  • Switch search method to simple LIKE matching instead of tsvector/tsquery

Previously we used scores from ts_rank_cd() to sort results, but it didn't work because the function returns same score for all results. It's not for calculate similarity of single words. Sometimes this bug even push out exact matching tag from results.

Additionally, PostgreSQL supports prefix searching with standard btree index. Using it offers simpler code, but also less index size and some speed.

@Gargron
Gargron approved these changes Jun 6, 2017
@Gargron

This comment has been minimized.

Copy link
Member

commented Jun 6, 2017

There's just two style issues. Please use single-quotes when there is no string interpolation.

* Sort results by the name
* Switch search method to simple `LIKE` matching instead of tsvector/tsquery

Previously we used scores from ts_rank_cd() to sort results, but it didn't work
because the function returns same score for all results. It's not for calculate
similarity of single words. Sometimes this bug even push out exact matching tag
from results.

Additionally, PostgreSQL supports prefix searching with standard btree index.
Using it offers simpler code, but also less index size and some speed.
@unarist unarist force-pushed the unarist:fix-tag-order branch from 40375aa to 7779c7b Jun 6, 2017
@Gargron Gargron merged commit 004672a into tootsuite:master Jun 6, 2017
2 checks passed
2 checks passed
codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@unarist unarist referenced this pull request Jun 15, 2017
1 of 2 tasks complete
@unarist unarist deleted the unarist:fix-tag-order branch Jun 21, 2017
koteitan added a commit to koteitan/mastodon that referenced this pull request Jun 25, 2017
* Sort results by the name
* Switch search method to simple `LIKE` matching instead of tsvector/tsquery

Previously we used scores from ts_rank_cd() to sort results, but it didn't work
because the function returns same score for all results. It's not for calculate
similarity of single words. Sometimes this bug even push out exact matching tag
from results.

Additionally, PostgreSQL supports prefix searching with standard btree index.
Using it offers simpler code, but also less index size and some speed.
YaQ00 added a commit to YaQ00/mastodon that referenced this pull request Sep 5, 2017
* Sort results by the name
* Switch search method to simple `LIKE` matching instead of tsvector/tsquery

Previously we used scores from ts_rank_cd() to sort results, but it didn't work
because the function returns same score for all results. It's not for calculate
similarity of single words. Sometimes this bug even push out exact matching tag
from results.

Additionally, PostgreSQL supports prefix searching with standard btree index.
Using it offers simpler code, but also less index size and some speed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.