What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, for the latest spryker version... Should we use the searchClient or the searchElasticSearchClien

UK7KBE2JW
UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi, for the latest spryker version... Should we use the searchClient or the searchElasticSearchClient?

Β«1

Comments

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey!
    You should use SearchClient. It will delegate calls to the vendor specific search client if you have one. By default, with the latest release and proper migration, it will delegate it to SearchElasticSearchClient as the only one available, but if you have an old version or didn’t migrated properly it will use previous realisation as a fallback.

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi, thank you for the information. I upgraded to the latest spryker modules and now I do net get the category and product pages to work. And it seems there is even a bug or missconfiguration for me

    Exception
    Your query class "Spryker\Client\Search\Plugin\Elasticsearch\Query\SearchKeysQuery" must implement Spryker\Client\SearchExtension\Dependency\Plugin\SearchContextAwareQueryInterface interface.
    
  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    the search index is switched from _search to _page

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    I have fixed the exception for me locally so this works

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Is it one of the core query classes that throws the exception?

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Could you send me exact class, that I can check what is wrong?

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    in zed under maintenance search

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    vendor/spryker/search/src/Spryker/Client/Search/SearchFactory.php uses the deprecated vendor/spryker/search/src/Spryker/Client/Search/Plugin/Elasticsearch/Query/SearchKeysQuery.php

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    in vendor/spryker/search/src/Spryker/Client/Search/Delegator/SearchDelegator.php:52 you check for

    instanceof SearchContextAwareQueryInterface
    
  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yep. All query classes should implement this new interface.
    What version of spryker/catalog module fo you have?

    As for maintenance page, as I know, it’s unavailable for now with new approach. The new maintenance page should be released soon.

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    5.6.0

    "name": "spryker/catalog",
                "version": "5.6.0",
                "source": {
                    "type": "git",
                    "url": "<https://github.com/spryker/catalog.git>",
                    "reference": "5b8b4611b2624f4c96a0170ebb7779bf9c30fac9"
                },
                "dist": {
                    "type": "zip",
                    "url": "<https://api.github.com/repos/spryker/catalog/zipball/5b8b4611b2624f4c96a0170ebb7779bf9c30fac9>",
                    "reference": "5b8b4611b2624f4c96a0170ebb7779bf9c30fac9",
                    "shasum": ""
                }
    
  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Sorry, catalog is definitely not the case. Missed a few messages that you sent πŸ˜”

    As I said, maintenance page is broken right now and doesn’t work with a new approach. Fix for is on the way, and it should represent separate page for specific vendor that is in use. I can notify you when it’s live.

    For the actual search functionality, we still use Search module as an entry point.

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok thank you. so i have to keep debugging

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Let me know, if you have other questions. I’m glad to help

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe you have a clue how I can check if everything is configured right or how I can debug why every category and product ends in a 404?

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    urls are available in redis

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    and for the yves router cache warmup, should there something gernerated for the catalog page, pdp etc.?

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet
  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Sorry, was away from the computer. Let me check

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    So, regarding, why do you ends on the 404 page, I’m not sure for now. Need some more context. But it might be related to your next question.

    We have a few router plugins for the yves. One of them uses that cache that is generated by yves router cache warmup command. But we have a few more. Next one is the

    StorageRouterPlugin
    

    that actually used for cases with pdp and catalog page. It requires that such resources registered in the

    StorageRouterDependencyProvider::getResourceCreatorPlugins()
    
  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    So

    RouterDependencyProvider::getRouterPlugins()
    

    should have

    StorageRouterPlugin
    

    registered

    And for registering resources you need register them in the

    StorageRouterDependencyProvider
    
  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet
    <?php
    
    /**
     * This file is part of the Spryker Suite.
     * For full license information, please view the LICENSE file that was distributed with this source code.
     */
    
    namespace Pyz\Yves\StorageRouter;
    
    use SprykerShop\Yves\CatalogPage\Plugin\StorageRouter\CatalogPageResourceCreatorPlugin;
    use SprykerShop\Yves\CmsPage\Plugin\StorageRouter\PageResourceCreatorPlugin;
    use SprykerShop\Yves\MerchantProfilePage\Plugin\MerchantProfilePageResourceCreatorPlugin;
    use SprykerShop\Yves\ProductDetailPage\Plugin\StorageRouter\ProductDetailPageResourceCreatorPlugin;
    use SprykerShop\Yves\ProductSetDetailPage\Plugin\StorageRouter\ProductSetDetailPageResourceCreatorPlugin;
    use SprykerShop\Yves\RedirectPage\Plugin\StorageRouter\RedirectResourceCreatorPlugin;
    use SprykerShop\Yves\StorageRouter\StorageRouterDependencyProvider as SprykerShopStorageRouterDependencyProvider;
    
    class StorageRouterDependencyProvider extends SprykerShopStorageRouterDependencyProvider
    {
        /**
         * @return \SprykerShop\Yves\StorageRouterExtension\Dependency\Plugin\ResourceCreatorPluginInterface[]
         */
        protected function getResourceCreatorPlugins(): array
        {
            return [
                new PageResourceCreatorPlugin(),
                new CatalogPageResourceCreatorPlugin(),
                new ProductDetailPageResourceCreatorPlugin(),
                new ProductSetDetailPageResourceCreatorPlugin(),
                new RedirectResourceCreatorPlugin(),
                new MerchantProfilePageResourceCreatorPlugin(),
            ];
        }
    }
    
  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    smth like that

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok thx for feedback

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    i have all plugins registered except merchant

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2020

    Hi @UJY8FHK99 I still get 404 on Catalog pages and for products

    "No route found for "GET ..."
    

    Exception. Maybe you have another hint for me where I can take a closer look? Plugins are available in collection

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey! I’ll check in a few minutes

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    thank you

  • Serhii Chepela
    Serhii Chepela Sprykee Posts: 49 πŸ§‘πŸ»β€πŸš€ - Cadet

    Would be nice if you can send me listing of yours

    Pyz\Yves\Router\RouterDependencyProvider
    

    and

    Pyz\Yves\StorageRouter\StorageRouterDependencyProvider