     |> update_in([:size], &(&1 = per_page))
   end
 
-  defp build_user_query(query, %{terms: "@" <> terms} = opts), do: build_username_query(query, Map.merge(opts, %{terms: terms}))
+  defp build_user_query(query, %{terms: "@" <> terms} = opts), do: build_user_query(query, Map.merge(opts, %{terms: terms}))
   defp build_user_query(query, %{terms: terms} = opts) do
     filtered_terms = filter_terms(terms, opts[:allow_nsfw])
     update_in(query[:query][:bool][:must],

  def username_search(%{current_user: current_user} = opts) do
    following_ids = Network.following_ids(current_user)
    base_query()
    |> build_username_query(opts)
    |> build_relationship_query(following_ids)
    |> filter_blocked(current_user)
    |> search_user_index

                     fields: ["name", "username"],
                     analyzer: "standard",
                     minimum_should_match: "100%"}} | &1]))
  end

  defp build_relationship_query(query, []), do: query
