We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I'm using the library in a personal project, and I kind of missed the ability to use it like this:
:meili |> Meilisearch.client() |> Meilisearch.Index.create(%{uid: @index, primaryKey: "uuid"}) |> Meilisearch.Settings.update( @index, %{ searchableAttributes: ["name", "category", "short_name"], displayedAttributes: ["name", "category", "popular", "image", "popular", "price", "uuid"], filterableAttributes: ["category"], sortableAttributes: ["popular", "name"], synonyms: synonyms() } ) |> Meilisearch.Document.create_or_replace(@index, data)
Instead, I have to call each action as a different line client + create, client + settings, client + document.
client + create
client + settings
client + document
I don't know what I could suggest to make it work, but I just wanted to know if I'm thinking in the right way!
The text was updated successfully, but these errors were encountered:
We could achieve this behaviour by changing the API from this:
defmodule Meilisearch.Settings do def update(client, index, settings), do: {:ok, result} end
to this:
defmodule Meilisearch.Settings do def update({:ok, _, client}, index, settings), do: update(client, index, settings) def update(client, index, settings) when is_atom(client), do: client |> Meilisearch.client() |> update(index, settings) def update(client, index, settings), do: {:ok, result, client} end
Which would allow usage like this:
{:ok, sumtask, client} = :meili |> Meilisearch.Index.create(%{uid: @index, primaryKey: @primary}) |> Meilisearch.Settings.update(@index, @settings) |> Meilisearch.Document.create_or_replace(@index, documents)
In this case, you cannot access to the result of Index.create/3 and Settings.update/3 calls.
Index.create/3
Settings.update/3
But this is a breaking change as it changes the result tuple. That could break existing matching.
Sorry, something went wrong.
No branches or pull requests
Hi! I'm using the library in a personal project, and I kind of missed the ability to use it like this:
Instead, I have to call each action as a different line
client + create
,client + settings
,client + document
.I don't know what I could suggest to make it work, but I just wanted to know if I'm thinking in the right way!
The text was updated successfully, but these errors were encountered: