jaeyson / ex_typesense

Typesense client for Elixir with support for importing your Ecto schemas.
https://hexdocs.pm/ex_typesense
MIT License
29 stars 11 forks source link

Implemented basic multisearch endpoint support #32

Closed javiertoledo closed 3 months ago

javiertoledo commented 3 months ago

Hi @jaeyson,

I added this implementation to enable the multi_search endpoint for vector searches. When using vector embeddings, the request size tends to be much larger, and the Typesense documentation recommends using the multi-search endpoint to avoid potential limits using GET requests.

I've implemented a small test for the vector embedding scenario and drafted the @doc comments, trying to mimic your code style. However, I haven't implemented an integration with Ecto because I didn't need it. Please let me know your thoughts, and feel free to close the PR and rework it in your way.

Thanks again for this nice library!

jaeyson commented 3 months ago

Hi @javiertoledo thank you for your contrib! 🙏🏾

I've made an update on the library just now (0.4.3) concerning with the recent issue. There's one change that we need for this (based on the recent PR #30): We changed the connection struct into a plain map, so long as it matches the type

@type t() :: %{
  host: String.t() | nil,
  api_key: String.t() | nil,
  port: non_neg_integer() | nil,
  scheme: String.t() | nil
}
jaeyson commented 3 months ago

Hi @javiertoledo I can merge this to main, with the changes needed that I commented.

Here's what I'll do:

just so there's no blocker on using the library. How's that working for you?

javiertoledo commented 3 months ago

Sure thing, @jaeyson. I'm using this change from my fork and it's working fine for me, but feel free to pull the branch and change it on your side. Once everything is merged and a new version released, I'll redirect my mix.exs back to the official package.

jaeyson commented 3 months ago

Hi @javiertoledo, I'll transfer this PR to #35 (kindly check). Again, thank you for helping me out!