Skip to content

Commit

Permalink
feat: Updated SetupMeilisearch function
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot14A committed May 15, 2023
1 parent 1b7c361 commit 759f4a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion meilisearchx/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var ranking_attributes []string
var stop_words []string

// SetupMeiliSearch setups the meili search server index
func SetupMeiliSearch(searchableAttributes, filterableAttributes, sortableAttributes, rankingAttritubes, stopWords []string) error {
func SetupMeiliSearch(indexes, searchableAttributes, filterableAttributes, sortableAttributes, rankingAttritubes, stopWords []string) error {
Client = meilisearch.NewClient(
meilisearch.ClientConfig{
Host: viper.GetString("meili_url"),
Expand All @@ -31,6 +31,10 @@ func SetupMeiliSearch(searchableAttributes, filterableAttributes, sortableAttrib
ranking_attributes = rankingAttritubes
stop_words = stopWords

for _, indexName := range indexes {
setupIndex(indexName)
}

return nil
}

Expand Down

0 comments on commit 759f4a7

Please sign in to comment.