August 2024
Intermediate to advanced
374 pages
8h 44m
English
To start your book search application, create a new Phoenix project with mix phx.new:
| | mix phx.new book_search |
Now, run the following command to change to the root directory of your project and list its contents:
| | cd book_search && ls |
The output of this command will look like this:
| | assets _build config deps lib mix.exs mix.lock priv README.md test |
Next, you’ll need to install pgvector. Start by adding pgvector as a dependency in your mix.exs:
| | {:pgvector, "~> 0.2.0"} |
Then run mix deps.get. Next, create a new file lib/postgrex_types.ex and add the following code:
| | Postgrex.Types.define( |
| | BookSearch.PostgrexTypes, |
| | [Pgvector.Extensions.Vector] ++ Ecto.Adapters.Postgres.extensions(), |
| | [] |
| | ) |
Next, add the following ...
Read now
Unlock full access