major performance improvements map

This commit is contained in:
Christian Beutel
2025-04-14 20:22:39 +02:00
parent a1296ebacd
commit 5390b9cf72
9 changed files with 165 additions and 17 deletions

View File

@@ -0,0 +1,30 @@
package migrations
import (
"os"
"github.com/meilisearch/meilisearch-go"
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
client := meilisearch.New(os.Getenv("MEILI_URL"), meilisearch.WithAPIKey(os.Getenv("MEILI_MASTER_KEY")))
m.Register(func(app core.App) error {
searchableAttributes := []string{
"author_name",
"name",
"description",
"location",
"tags",
}
client.Index("trails").UpdateSearchableAttributes(&searchableAttributes)
return nil
}, func(app core.App) error {
// add down queries...
return nil
})
}