Skip to content

Commit

Permalink
tmpIndexの設定
Browse files Browse the repository at this point in the history
  • Loading branch information
kounoike committed Apr 30, 2023
1 parent 911d3db commit dd29977
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions meili/meilisearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,18 @@ func max(a, b int) int {
}

func (m *MeiliSearchClient) UpdateRecordedFiles(rows []db.ListRecordedFilesRow) error {
if _, err := m.client.CreateIndex(&meilisearch.IndexConfig{Uid: temporarilyRecordedFileIndexName, PrimaryKey: "id"}); err != nil {
return err
}
tmpIndex := m.Index(temporarilyRecordedFileIndexName)

if _, err := tmpIndex.UpdateSearchableAttributes(&[]string{"タイトル", "番組説明", "ジャンル", "番組詳細", "チャンネル名", "ARIB字幕", "文字起こし"}); err != nil {
return err
}
if _, err := tmpIndex.UpdateFilterableAttributes(&[]string{"チャンネル名", "ジャンル"}); err != nil {
return err
}

documents := make([]map[string]interface{}, 0, len(rows))
for idx, row := range rows {
document := map[string]interface{}{
Expand Down

0 comments on commit dd29977

Please sign in to comment.