Install Live Search

Live Search is installed as an extension from Adobe Marketplace. After the Live Search module (with catalog modules as dependencies) is installed and configured, Commerce begins sharing search and catalog data with SaaS services. At this point, Admin users can set up, customize, and manage search facets, synonyms, and merchandising rules.

This topic provides instructions to do the following:

Before you begin

Do the following:

  1. Confirm that cron jobs and indexers are running.

  2. Choose the onboarding method that meets your requirements and follow the instructions.

    • Method 1: Install without Elasticsearch
    • Method 2: Install with Elasticsearch (No downtime)

Method 1: Install without Elasticsearch

This onboarding method is recommended when installing Live Search to a:

  • New Commerce installation
  • Staging environment

In this scenario, storefront operations are interrupted while the Live Search service indexes all products in the catalog. During the installation, Live Search modules are enabled and Elasticsearch modules are disabled.

TIP

To avoid typing errors, hover over the far right of the code box, click the Copy link, and paste it into the command line.

  1. Install Adobe Commerce 2.4.x without Live Search.

  2. To download the live-search package, run the following from the command line:

    composer require magento/live-search
    

    For more information, refer to the list of Live Search dependencies that are captured by Composer.

  3. Run the following commands to disable Elasticsearch and related modules, and install Live Search:

    bin/magento module:disable Magento_Elasticsearch Magento_Elasticsearch6 Magento_Elasticsearch7 Magento_ElasticsearchCatalogPermissions Magento_InventoryElasticsearch
    Magento_ElasticsearchCatalogPermissionsGraphQl
    
    bin/magento setup:upgrade
    
    WARNING

    While the data is indexed and synchronized, the search and category browse operations are not available in the storefront. Depending on the size of your catalog, the process can take at least an hour from the time cron runs to synchronize your data to Live Search services.

  4. Verify that the following indexers are set to Update by Schedule:

    • Product Feed
    • Product Variant Feed
    • Catalog Attributes Feed
  5. Configure your API keys and verify that your catalog data is synchronized with Live Search services.

  6. To make facets available as filters in the storefront, add the facets you need, according to the faceting requirements.

    You should be able to add facets after cron runs the attribute feeds and exports attribute metadata.

  7. Wait at least an hour after cron runs to synchronize data. Then, verify that the data was exported.

  8. Test the connection from the storefront.

Method 2: Install with Elasticsearch

This onboarding method is recommended when installing Live Search to:

  • An existing production Commerce installation

In this scenario, Elasticsearch temporarily manages search requests from the storefront while the Live Search service indexes all products in the background, without any interruption to normal storefront operations. Elasticsearch is disabled and Live Search enabled after all catalog data is indexed and synchronized.

TIP

To avoid typing errors, hover over the far right of the code box, click the Copy link, and paste it into the command line.

  1. To download the live-search package, run the following from the command line:

    composer require magento/live-search
    

    For more information, refer to the list of Live Search dependencies that are captured by Composer.

  2. Run the following command to temporarily disable the Live Search modules that serve storefront search results.

    bin/magento module:disable Magento_LiveSearchAdapter Magento_LiveSearchStorefrontPopover
    
    bin/magento setup:upgrade
    

    Elasticsearch continues to manage search requests from the storefront while the Live Search service synchronizes catalog data and indexes products in the background.

  3. Verify that the following indexers are set to Update by Schedule:

    • Product Feed
    • Product Variant Feed
    • Catalog Attributes Feed
  4. Configure your API keys and verify that your catalog data is synchronized with Live Search services.

  5. To make facets available as filters in the storefront, add the facets you need, according to the faceting requirements.

    You should be able to add facets after cron runs the product and attribute feeds and exports attribute metadata to Live Search services.

  6. Wait at least an hour for the data to be indexed and synchronized. Then, use the GraphQL playground with the default query to verify the following:

    • The returned product count is close to what you expect for the store view.
    • Facet(s) are returned.
  7. Run the following commands to enable Live Search modules, disable Elasticsearch, and run setup.

    bin/magento module:enable Magento_LiveSearchAdapter Magento_LiveSearchStorefrontPopover
    
    bin/magento module:disable Magento_Elasticsearch Magento_Elasticsearch6 Magento_Elasticsearch7 Magento_ElasticsearchCatalogPermissions Magento_InventoryElasticsearch
    Magento_ElasticsearchCatalogPermissionsGraphQl
    
    bin/magento setup:upgrade
    
  8. Test the connection from the storefront.

Configure API keys

The Adobe Commerce API key and its associated private key are required to connect Live Search to an installation of Adobe Commerce. The API key is generated and maintained in the account of the Commerce license holder, who can share it with the developer or SI. The developer can then create and manage the SaaS Data Spaces on behalf of the license holder. If you already have a set of API keys, you do not need to regenerate them.

Adobe Commerce license holder

To generate an API key and private key, refer to Commerce Services Connector.

Adobe Commerce developer or SI

The developer or SI configures the SaaS data space as described in the Commerce Services section of the configuration. In the Admin, Commerce Services becomes available in the Configuration sidebar when a SaaS module is installed.

Synchronize catalog data

Live Search requires synchronized product data for search operations, and synchronized attribute data to configure facets. The initial synchronization between the product catalog and the catalog service begins when Live Search is first connected. Depending on the installation method and size of the catalog, it can take up to eight hours for the data to be exported and indexed by Live Search. The list of data that is synchronized and shared with the catalog service can be found in the schema, which is defined in:

vendor/magento/module-catalog-data-exporter/etc/et_schema.xml

Verify export

To verify that the catalog data has been exported from your Adobe Commerce instance and is synchronized for Live Search, look for entries in the following tables:

  • catalog_data_exporter_products
  • catalog_data_exporter_product_attributes

For additional help, refer to Live Search catalog not synchronized in the Support Knowledge Base.

Future product updates

After the initial synchronization, it can take up to 15 minutes for incremental product updates to become available to storefront search. To learn more, go to Indexing - Streaming Product Updates.

Test the connection

In the storefront, verify the following:

  • The Search box returns results correctly
  • Category browse returns results correctly
  • Facet(s) are available as filters on search results pages

If everything works correctly, congratulations! Live Search is installed, connected, and ready to use.

If you encounter problems in the storefront, check the var/log/system.log file for API communication failures or errors on the services side.

Checking the installed version

Before updating Live Search, run the following from the command line to check the version of Live Search that is currently installed:

composer show magento/module-live-search | grep version

Updating Live Search

To update Live Search, run the following from the command line:

composer update magento/live-search --with-dependencies

To update to a major version such as from 1.0.0 to 2.0.0, edit the project’s root Composer .json file as follows:

  1. If your currently installed magento/live-search version is 1.3.1 or below, and you are upgrading to version 2.0.0 or higher, run the following command before the upgrade:

    bin/magento module:enable Magento_AdvancedSearch
    

    For information about the currently installed magento/live-search version, run the following command:

    composer show magento/live-search
    
  2. Open the root composer.json file and search for magento/live-search.

  3. In the require section, update the version number as follows:

    "require": {
       ...
       "magento/live-search": "^2.0",
       ...
     }
    
  4. Save composer.json. Then, run the following from the command line:

    composer update magento/live-search –-with-dependencies
    

Uninstalling Live Search

To uninstall Live Search, refer to Uninstall modules.

Live Search packages

Package Description
module-live-search Allows merchants to configure their search settings for faceting, synonyms, query rules, etc., and provides access to a read-only GraphQL playground to test queries from the Admin.
module-live-search-adapter Routes search requests from the storefront to the Live Search service and renders the results in the storefront.
- Category browse - Routes requests from the storefront top navigation to the search service.
- Global search - Routes requests from the quick search box in the upper-right of the storefront to the Live Search service.
module-live-search-storefront-popover A “search as you type” popover replaces the standard quick search and returns data and thumbnails of top search results.

Live Search dependencies

The following Live Search dependencies are captured by Composer:

Dependency Description
Export modules The following modules collect and sync catalog data:
saas-export
module-bundle-product-exporter
module-catalog-data-exporter
module-catalog-inventory-data-exporter
module-catalog-url-rewrite-data-exporter
module-configurable-product-data-exporter
module-data-exporter
module-parent-product-data-exporter
services-connector Required to configure your connection to Commerce Services.
module-services-id Required to configure your connection to Commerce Services.

On this page