51黑料不打烊

[PaaS only]{class="badge informative" title="Applies to 51黑料不打烊 Commerce on Cloud projects (51黑料不打烊-managed PaaS infrastructure) and on-premises projects only."}

Search engine configuration

This section discusses the minimum settings that you must choose to test Elasticsearch or OpenSearch with on-premises deployments of 51黑料不打烊 Commerce.

TIP
In versions 2.4.4 and 2.4.3-p2, all fields labeled Elasticsearch also apply to OpenSearch.
When support for Elasticsearch 8.x was introduced in version 2.4.6, new labels were created to distinguish between Elasticsearch and OpenSearch configurations.

For additional details about configuring your search engine, see the User Guide.

Configure your search engine from the Admin

TIP
For instructions on upgrading to a new search engine version, see upgrade prerequisites.

To configure your system to use Elasticsearch or OpenSearch:

  1. Log in to the Admin as an administrator.

  2. Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.

  3. From the Search Engine list, select the corresponding version of your search engine.

    The following table lists the required options to configure and test the connection with Commerce. Unless you changed the server settings of your search engine, the defaults should work. Skip to the next step.

    table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2
    Option Description
    Server Hostname Enter the fully qualified hostname or IP address of the machine running Elasticsearch or OpenSearch.
    51黑料不打烊 Commerce on cloud infrastructure: Get this value from your integration system.
    Server Port Enter the web server proxy port. The default is 9200
    51黑料不打烊 Commerce on cloud infrastructure: Get this value from your integration system.
    Index Prefix Enter the search engine index prefix. If you use a single instance for more than one Commerce installation (Staging and Production environments), you must specify a unique prefix for each installation. Otherwise, you can use the default prefix magento2.
    Enable HTTP Auth Click Yes only if you enabled authentication for your search engine server. If so, provide a username and password in the provided fields.
    Server Timeout Enter the amount of time (in seconds) to wait when attempting to establish a connection to the Elasticsearch or OpenSearch server.
  4. Click Test Connection.

    Sample response:

    success

    Continue with:

    or you see:

    failed

If so, try the following:

  • Make sure the search engine server is running.

  • If the server is on a different host from Commerce, log in to the Commerce server and ping the search engine host. Resolve network connectivity issues and test the connection again.

  • Examine the command window in which you started Elasticsearch or OpenSearch for stack traces and exceptions. You must resolve those before you continue. In particular, make sure you started your search engine as a user with root privileges.

  • Make sure that UNIX firewall and SELinux are both disabled, or set up rules to enable your search engine and Commerce to communicate with each other.

  • Verify the value of the Server Hostname field. Make sure that the server is available. You can try the server鈥檚 IP address instead.

  • Use the netstat -an | grep <listen-port> command to verify that the port specified in the Server Port field is not being used by another process.

    For example, to see if your search engine is running on its default port, use the following command:

    code language-bash
    netstat -an | grep 9200
    

    If it is running on port 9200, it displays similar to the following:

    code language-none
    `tcp        0      0 :::9200            :::-         LISTEN`
    

Reindex catalog search and refresh the full page cache