most importantly: new category and filter on is_new

This commit is contained in:
Daniel Goc
2026-04-13 15:29:21 +02:00
parent 7f05d39b38
commit ce4cadaa16
14 changed files with 159 additions and 189 deletions

View File

@@ -6,7 +6,7 @@ import (
"git.ma-al.com/goc_daniel/b2b/app/config"
"git.ma-al.com/goc_daniel/b2b/app/model"
"git.ma-al.com/goc_daniel/b2b/app/repos/productDescriptionRepo"
searchrepo "git.ma-al.com/goc_daniel/b2b/app/repos/searchRepo"
constdata "git.ma-al.com/goc_daniel/b2b/app/utils/const_data"
"github.com/meilisearch/meilisearch-go"
)
@@ -20,8 +20,8 @@ type MeiliIndexSettings struct {
}
type MeiliService struct {
productDescriptionRepo productDescriptionRepo.UIProductDescriptionRepo
meiliClient meilisearch.ServiceManager
searchRepo searchrepo.UISearchRepo
meiliClient meilisearch.ServiceManager
}
func New() *MeiliService {
@@ -32,8 +32,8 @@ func New() *MeiliService {
)
return &MeiliService{
meiliClient: client,
productDescriptionRepo: productDescriptionRepo.New(),
meiliClient: client,
searchRepo: searchrepo.New(),
}
}
@@ -50,7 +50,7 @@ func (s *MeiliService) CreateIndex(id_lang uint) error {
for {
// Get batch of products from repo (includes scanning)
products, err := s.productDescriptionRepo.GetMeiliProducts(id_lang, offset, batchSize)
products, err := s.searchRepo.GetMeiliProducts(id_lang, offset, batchSize)
if err != nil {
return fmt.Errorf("failed to get products batch at offset %d: %w", offset, err)
}