Use Data Exchange Api to create a product - page_search entries missing

LukasB
LukasB lukas.bruecklmeier@unic.com Posts: 12 ✨ - Novice

Hello,

I'm currently trying to import products via the Data Exchange Api. I'm using this list of requests to create the product abstract and the one concrete:

  1. POST /dynamic-entity/product-abstracts
  2. POST /dynamic-entity/products
  3. POST /dynamic-entity/product-abstract-localized-attributes
  4. POST /dynamic-entity/product-localized-attributes
  5. POST /dynamic-entity/product-abstract-stores
  6. POST /dynamic-entity/product-categories
  7. POST /dynamic-entity/availability-abstracts
  8. POST /dynamic-entity/availabilities
  9. POST /dynamic-entity/stock-products
  10. POST /dynamic-entity/product-searches
  11. POST /dynamic-entity/price-products
  12. POST /dynamic-entity/price-product-stores
  13. POST /dynamic-entity/price-product-defaults

When I have a look at the data in the backoffice everything seems to be ok. However the product is not displayed in the storefront because the entries in the tables spy_product_abstract_page_search and spy_product_concrete_page_search are missing.

If I trigger a 'console publish:trigger-events' or save the product in the backoffice again the entires are there.

Has anybody encountered something similiar? Are there any events that are missing when using the Data Exchange Api or does the order of the requests matter?

Answers

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 55 🪐 - Explorer

    Good morning @LukasB!
    Just as a sanity check, did you try console sync:data?

    Also, are queues empty in rabbit? (no exceptions in the search queues?)

    Are the products marked as searchable?

  • LukasB
    LukasB lukas.bruecklmeier@unic.com Posts: 12 ✨ - Novice

    Good morning @victor.vanherpt!

    Thanks for your answer. Yes I also tried console sync:data but that doesn't yield any result.

    I also got no entries in any queues/ error queues in RabbitMQ.

    And yes, the concrete product is marked as searchable.

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 55 🪐 - Explorer

    ah, it was worth checking the low hanging fruit :)

    Good luck, I would be interested to see some comment if you find a solution

  • Fred Jung
    Fred Jung Spryker Customer Posts: 24 ✨ - Novice
    edited July 16

    In 5+ horrible years of product import I can say for sure: No trigger no P&S 😂

    You can implement a check on spy_product to see which product was updated and then get concrete/abstract id in order to run trigger-events with -r product-concrete/product-abstract and —ids/i.

    Best one is

    vendor/bin/console publish:trigger-events -r product_configuration,product_abstract_category,url,product_concrete,product_abstract,availability
    

    REALLY, don´t try to work around, it will always have a sideeffect which will get you nuts 🤣

  • LukasB
    LukasB lukas.bruecklmeier@unic.com Posts: 12 ✨ - Novice

    Thanks @Fred Jung! I was hoping not to run any publish:trigger-events commands because the events are fired already when the table is filled within the data exchange api request