add: abstract search functionality to core + adjust meilisearch-plugin

add SearchService interface to medusa-interfaces
add DefaultSearchService skeleton implementation to core
add search-index.js loader to core for indexing db documents
add SearchSubscriber to core
add loadToSearchEngine method in ProductService
switch order of loaders in core to load subscriptions AFTER plugins
adjust service and loader for medusa-plugin-meilisearch
This commit is contained in:
zakariaelas
2021-09-16 15:48:09 +01:00
parent 425c8a5e5d
commit 0fbde7c51f
24 changed files with 405 additions and 187 deletions
@@ -1,29 +0,0 @@
export const flattenSkus = (product) => {
const skus = product.variants.map((v) => v.sku).filter(Boolean)
product.sku = skus
return product
}
export const defaultProductFields = [
"id",
"title",
"subtitle",
"description",
"handle",
"is_giftcard",
"discountable",
"thumbnail",
"profile_id",
"collection_id",
"type_id",
"origin_country",
"created_at",
"updated_at",
]
export const defaultProductRelations = [
"variants",
"tags",
"type",
"collection",
]