diff options
author | rinpatch <rinpatch@sdf.org> | 2019-10-16 12:52:47 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-10-18 14:56:14 +0300 |
commit | 713b2187b93ebda5533e67173d82745eb15ba650 (patch) | |
tree | 733ec9cd1f1b3d9e7dd698897f3a598957973052 /test | |
parent | 4123c9db0736f53d40792ca0a94b7c7724e544a2 (diff) | |
download | pleroma-713b2187b93ebda5533e67173d82745eb15ba650.tar.gz |
User search: Remove trigram and refactor the module
- Remove trigram as it tends to rank garbage results highly, resulting
in it prioritized above fts, which gives actually decent results. ACKed
by kaniini and lain on irc.
- Remove a test for handling misspelled requests, since we no longer have
trigram
- Remove a test for searching users with `nil` display names, because it
is unrealistic, we don't accept usernames that are not >1 char strings
- Make rank boosting for followers/followees sane again, previous values
resulted in garbage matches getting on top just because the users are
followers/followees
Diffstat (limited to 'test')
-rw-r--r-- | test/user_search_test.exs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/test/user_search_test.exs b/test/user_search_test.exs index 48ce973ad..341074031 100644 --- a/test/user_search_test.exs +++ b/test/user_search_test.exs @@ -74,12 +74,6 @@ defmodule Pleroma.UserSearchTest do assert [u4.id, u3.id, u1.id] == Enum.map(User.search("lain@ple", for_user: u1), & &1.id) end - test "finds users, handling misspelled requests" do - u1 = insert(:user, %{name: "lain"}) - - assert [u1.id] == Enum.map(User.search("laiin"), & &1.id) - end - test "finds users, boosting ranks of friends and followers" do u1 = insert(:user) u2 = insert(:user, %{name: "Doe"}) @@ -163,17 +157,6 @@ defmodule Pleroma.UserSearchTest do Pleroma.Config.put([:instance, :limit_to_local_content], :unauthenticated) end - test "finds a user whose name is nil" do - _user = insert(:user, %{name: "notamatch", nickname: "testuser@pleroma.amplifie.red"}) - user_two = insert(:user, %{name: nil, nickname: "lain@pleroma.soykaf.com"}) - - assert user_two == - User.search("lain@pleroma.soykaf.com") - |> List.first() - |> Map.put(:search_rank, nil) - |> Map.put(:search_type, nil) - end - test "does not yield false-positive matches" do insert(:user, %{name: "John Doe"}) |