From 763977c99f2f0873245c0dd05d08b0ed03baf483 Mon Sep 17 00:00:00 2001 From: Christian Beutel <> Date: Sun, 26 Jan 2025 18:16:48 +0100 Subject: [PATCH] removes meili dump docs --- db/migrations/1709593298_collections_snapshot.go | 12 ++++++++++++ .../content/docs/getting-started/installation.mdx | 8 +------- .../docs/getting-started/local-development.md | 14 -------------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/db/migrations/1709593298_collections_snapshot.go b/db/migrations/1709593298_collections_snapshot.go index dfbb4978..e9015157 100644 --- a/db/migrations/1709593298_collections_snapshot.go +++ b/db/migrations/1709593298_collections_snapshot.go @@ -2,7 +2,9 @@ package migrations import ( "encoding/json" + "os" + "github.com/meilisearch/meilisearch-go" "github.com/pocketbase/dbx" "github.com/pocketbase/pocketbase/daos" m "github.com/pocketbase/pocketbase/migrations" @@ -10,7 +12,17 @@ import ( ) func init() { + client := meilisearch.New(os.Getenv("MEILI_URL"), meilisearch.WithAPIKey(os.Getenv("MEILI_MASTER_KEY"))) + m.Register(func(db dbx.Builder) error { + _, err := client.CreateIndex(&meilisearch.IndexConfig{ + Uid: "trails", + PrimaryKey: "id", + }) + if err != nil { + return err + } + jsonData := `[ { "id": "_pb_users_auth_", diff --git a/docs/src/content/docs/getting-started/installation.mdx b/docs/src/content/docs/getting-started/installation.mdx index 242fb219..1dd8b226 100644 --- a/docs/src/content/docs/getting-started/installation.mdx +++ b/docs/src/content/docs/getting-started/installation.mdx @@ -29,7 +29,7 @@ x-common-env: &cenv services: search: container_name: wanderer-search - image: flomp/wanderer-search + image: getmeili/meilisearch:v1.11.3 environment: <<: *cenv MEILI_NO_ANALYTICS: true @@ -125,12 +125,6 @@ While not recommended it is absolutely possible to install wanderer from source. ### meilisearch wanderer uses meilisearch without any further modifications. As a result, you can simply head over to [their website](https://www.meilisearch.com/docs/learn/getting_started/installation) and follow the instructions for your preferred platform. We assume that you put the binary in the `wanderer/search` directory. If you did not, adapt the launch script below accordingly. -Furthermore, you will need to import the cities index manually. To do so launch meilisearch once with `--import-dump` parameter: -```bash -./meilisearch --import-dump migrations/migration.dump -``` -Wait for the process to finish and terminate meilisearch afterwards. - ### PocketBase wanderer uses a slightly modified version of the PocketBase backend framework. As a result, you will need to build the PocketBase binary first. ```bash diff --git a/docs/src/content/docs/getting-started/local-development.md b/docs/src/content/docs/getting-started/local-development.md index a05959e2..ff149dea 100644 --- a/docs/src/content/docs/getting-started/local-development.md +++ b/docs/src/content/docs/getting-started/local-development.md @@ -31,17 +31,6 @@ Sometimes it can be useful to edit data directly in the database. `PocketBase` o When you are done with development and would like to build wanderer for production there are some steps to follow. -### meilisearch - -If you modified any attributes of one of the meilisearch indices (like filterable attributes), you will need to create a new dump that gets imported into wanderer on launch. To do so run - -```bash -curl -X POST 'http://127.0.0.1:7700/dumps' -``` - -and overwrite the previous dump at `/search/migrations/migration.dump` with your updated one. - - ### PocketBase If you modified code in any of the `*.go` files make sure to build an updated binary with `go build`. In case you only edited tables via the `PocketBase` admin panel you don't need to do anything. The database will be migrated automatically. @@ -56,9 +45,6 @@ For the frontend there are no further caveats. Simply run `npm run build`. To create local docker images of wanderer simply run the script below. These will work as drop-in replacements for the ones hosted on docker hub. This will only work if you have already completed the steps above. ```bash -# search -docker build search/ --no-cache -t flomp/wanderer-search:latest - # db docker build db/ --no-cache -t flomp/wanderer-db:latest