mirror of
https://github.com/ash-project/ash_hq.git
synced 2024-09-19 21:03:30 +12:00
chore: lint/warnings
This commit is contained in:
parent
95c1d7b486
commit
2395c0b0ca
3 changed files with 3 additions and 22 deletions
|
@ -45,7 +45,7 @@ defmodule AshHq.Docs.Extensions.Search.Transformers.AddSearchStructure do
|
|||
:searchable | currently_ignored_attributes
|
||||
])
|
||||
|> add_search_headline_calculation(config)
|
||||
|> add_matches_calculation(config)
|
||||
|> add_matches_calculation()
|
||||
|> add_full_text_column(config)
|
||||
|> add_full_text_index()
|
||||
|> add_match_rank_calculation(config)
|
||||
|
@ -232,7 +232,7 @@ defmodule AshHq.Docs.Extensions.Search.Transformers.AddSearchStructure do
|
|||
)
|
||||
end
|
||||
|
||||
defp add_matches_calculation(dsl_state, config) do
|
||||
defp add_matches_calculation(dsl_state) do
|
||||
Transformer.add_entity(
|
||||
dsl_state,
|
||||
[:calculations],
|
||||
|
|
|
@ -32,23 +32,4 @@ defmodule AshHq.Docs.Search.Steps.BuildResults do
|
|||
false
|
||||
end
|
||||
end
|
||||
|
||||
# defp name_match_rank(%resource{} = record) do
|
||||
# if AshHq.Docs.Extensions.Search.has_name_attribute?(resource) &&
|
||||
# record.name_matches do
|
||||
# -(100_000 - search_length(record))
|
||||
# else
|
||||
# 0
|
||||
# end
|
||||
# end
|
||||
|
||||
defp search_length(%resource{} = record) do
|
||||
case AshHq.Docs.Extensions.Search.name_attribute(resource) do
|
||||
nil ->
|
||||
0
|
||||
|
||||
doc_attribute ->
|
||||
String.length(Map.get(record, doc_attribute))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ defmodule AshHqWeb.Components.Search do
|
|||
|
||||
require Ash.Query
|
||||
|
||||
alias AshHqWeb.Components.{CalloutText, Catalogue}
|
||||
alias AshHqWeb.Components.Catalogue
|
||||
alias AshHqWeb.DocRoutes
|
||||
alias Phoenix.LiveView.JS
|
||||
alias Surface.Components.{Form, LivePatch}
|
||||
|
|
Loading…
Reference in a new issue