removes meili dump docs

This commit is contained in:
Christian Beutel
2025-01-26 18:16:48 +01:00
parent f34fd7afed
commit 763977c99f
3 changed files with 13 additions and 21 deletions

View File

@@ -2,7 +2,9 @@ package migrations
import ( import (
"encoding/json" "encoding/json"
"os"
"github.com/meilisearch/meilisearch-go"
"github.com/pocketbase/dbx" "github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos" "github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations" m "github.com/pocketbase/pocketbase/migrations"
@@ -10,7 +12,17 @@ import (
) )
func init() { func init() {
client := meilisearch.New(os.Getenv("MEILI_URL"), meilisearch.WithAPIKey(os.Getenv("MEILI_MASTER_KEY")))
m.Register(func(db dbx.Builder) error { m.Register(func(db dbx.Builder) error {
_, err := client.CreateIndex(&meilisearch.IndexConfig{
Uid: "trails",
PrimaryKey: "id",
})
if err != nil {
return err
}
jsonData := `[ jsonData := `[
{ {
"id": "_pb_users_auth_", "id": "_pb_users_auth_",

View File

@@ -29,7 +29,7 @@ x-common-env: &cenv
services: services:
search: search:
container_name: wanderer-search container_name: wanderer-search
image: flomp/wanderer-search image: getmeili/meilisearch:v1.11.3
environment: environment:
<<: *cenv <<: *cenv
MEILI_NO_ANALYTICS: true MEILI_NO_ANALYTICS: true
@@ -125,12 +125,6 @@ While not recommended it is absolutely possible to install wanderer from source.
### meilisearch ### 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. 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 ### PocketBase
wanderer uses a slightly modified version of the PocketBase backend framework. As a result, you will need to build the PocketBase binary first. wanderer uses a slightly modified version of the PocketBase backend framework. As a result, you will need to build the PocketBase binary first.
```bash ```bash

View File

@@ -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. 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 ### 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. 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. 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 ```bash
# search
docker build search/ --no-cache -t flomp/wanderer-search:latest
# db # db
docker build db/ --no-cache -t flomp/wanderer-db:latest docker build db/ --no-cache -t flomp/wanderer-db:latest