vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
MIT License
5.41k stars 951 forks source link

Importing Data - Search Index Item Collection Columns Problem #2927

Open onursonmez opened 4 days ago

onursonmez commented 4 days ago

Describe the bug I tried to import a product with the import feature in the src/import-from-other-platform.ts section at https://docs.vendure.io/guides/developer-guide/importing-data/, but the collectionIds and collectionSlugs columns in the search_index_item table are empty. I realized it was. If I manually enter data here, the product appears, but when it is empty, the product does not appear.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://docs.vendure.io/guides/developer-guide/importing-data/ and test src/import-from-other-platform.ts section.
  2. Although it belongs to a collection on the product detail page, you will see that the collectionIds and collectionSlugs sections in the search_index_item section of the database are empty.

Environment (please complete the following information):

Additional context

Screenshot 2024-06-30 at 20 36 15
  1. The product has a collection and the collection facet adjustment has been made. If I manually write a category in the collectionIds and collectionSlugs sections of the search_index_item table, the product is displayed in the frontend.

  2. Screenshot 2024-06-30 at 20 44 27

    There is no error in the facet section of the import script. I can see on the product detail page that the facet is correct.

onursonmez commented 4 days ago

Additional information: Even though I manually reindexed the product listing page, these columns are still empty, but if I go to collection and make an update, then it gets fixed.

onursonmez commented 4 days ago

I think the problem is due to the lack of imported variant data in the collection_product_variants_product_variant table. When you enter the imported product and perform any update, it inserts the variants into this table and the collectionIds and collectionSlugs columns in the search_index_item table are filled. The screenshot is attached.

Screenshot 2024-06-30 at 21 32 48