diff options
author | rinpatch <rinpatch@sdf.org> | 2019-10-16 12:52:47 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-10-16 12:52:47 +0300 |
commit | c10ce113d487d71c4daa6fabcc641a5caa0d04cb (patch) | |
tree | 673f24701da2bd1725f935bc05f126e2e4074e31 /test | |
parent | 3b1bc079af8fb6e467a9114de0d32e2de59a7fab (diff) | |
download | pleroma-c10ce113d487d71c4daa6fabcc641a5caa0d04cb.tar.gz pleroma-c10ce113d487d71c4daa6fabcc641a5caa0d04cb.zip |
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 f7ab31287..e413f0893 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"}) |