refactor: remove unused fields parameter from fuzzy_search API
The fields parameter was accepted but never used in the :search action. Simplify API to only accept the query parameter. Update @doc to reflect the actual functionality.
This commit is contained in:
parent
12f95c1998
commit
062dad99fb
1 changed files with 1 additions and 8 deletions
|
|
@ -481,7 +481,6 @@ defmodule Mv.Membership.Member do
|
||||||
- `query` - Ash.Query.t() to apply search to
|
- `query` - Ash.Query.t() to apply search to
|
||||||
- `opts` - Keyword list or map with search options:
|
- `opts` - Keyword list or map with search options:
|
||||||
- `:query` or `"query"` - Search string
|
- `:query` or `"query"` - Search string
|
||||||
- `:fields` or `"fields"` - Optional field restrictions
|
|
||||||
|
|
||||||
## Returns
|
## Returns
|
||||||
- Modified Ash.Query.t() with search filters applied
|
- Modified Ash.Query.t() with search filters applied
|
||||||
|
|
@ -502,13 +501,7 @@ defmodule Mv.Membership.Member do
|
||||||
if String.trim(q) == "" do
|
if String.trim(q) == "" do
|
||||||
query
|
query
|
||||||
else
|
else
|
||||||
args =
|
Ash.Query.for_read(query, :search, %{query: q})
|
||||||
case opts[:fields] || opts["fields"] do
|
|
||||||
nil -> %{query: q}
|
|
||||||
fields -> %{query: q, fields: fields}
|
|
||||||
end
|
|
||||||
|
|
||||||
Ash.Query.for_read(query, :search, args)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue