2

I have configured elasticsearch properly. I have tested the connection which result me success message.

The issue I am facing is I am not able to see products in my catalog category frontend. When I tried to look into the index created in elasticsearch I found it blank.

When I reindex I get this error

Design Config Grid index has been rebuilt successfully in 00:00:06
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search indexer process unknown error:
illegal_argument_exception: Illegal dynamic template parameter: [match_mapping]
Product/Target Rule index has been rebuilt successfully in 00:00:00
Target Rule/Product index has been rebuilt successfully in 00:00:00
Sales Rule index has been rebuilt successfully in 00:00:00

Whats this

 Catalog Search indexer process unknown error:
    illegal_argument_exception: Illegal dynamic template parameter: [match_mapping]

Why am I getting this error when using with elasticsearch. Is there something I have to map?

3
+50

You need to install a version 2.x of Elasticsearch, example 2.4.6

| improve this answer | |
  • Magento by default requires 2x version: "elasticsearch/elasticsearch": "~2.0" – zhartaunik Nov 1 '17 at 12:05
2

Magento added support for Elasticsearch 5+ in 2.2.2 or 2.2.3 (before that only 2.x was supported), and to use that you need to set the Search Engine setting to Elasticsearch 5.0+ in admin, or

  • magento config:set catalog/search/elasticsearch5_server_hostname elasticsearch
    (where elasticsearch your ElasticSearch server hostname)
  • magento config:set catalog/search/engine elasticsearch5

in CLI.

| improve this answer | |
  • It's weird, but I got following: Catalog Search indexer process unknown error: Indexer handler is not available: elasticsearch5. – Kirby Sep 17 '18 at 12:30
  • I just missed to set hostname: magento config:set catalog/search/elasticsearch5_server_hostname elasticsearch. Now it's working. – Kirby Sep 17 '18 at 12:41
1

You should not use latest version of elasticsearch. The idea is following: there are 3 different elasticsearches:

According magento extension config it requires following version of php elasticsearch extension: "elasticsearch/elasticsearch": "~2.0".

When you are configuring your environment, you most likely trying to use latest version of elasticsearch java extension. For today latest version is 5.5.2, which is not compatible with php extension v.2.0.

However latest version of php extension is 5.0. Suppose that if you modify magento extension use php extension 2.0 - everything can work (if it's compatible with that version :) )

Wrong way

www-data@magento2-cron:~/magento$ curl -XGET 'elasticsearch:9200'
{
  "name" : "blabla",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "blablablabla",
  "version" : {
    "number" : "5.5.2",
    "build_hash" : "blablablabla",
    "build_date" : "2017-08-14T12:33:14.154Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}

Attempt to reindex:

www-data@magento2-cron:~/magento$ php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
illegal_argument_exception: Illegal dynamic template parameter: [match_mapping]

Correct way

www-data@magento2-cron:~/magento$ curl -XGET 'elasticsearch:9200' 
{
  "name" : "blabla",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "blablablabla",
  "version" : {
    "number" : "2.4.6",
    "build_hash" : "blablablabla",
    "build_timestamp" : "2017-07-18T12:17:44Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.4"
  },
  "tagline" : "You Know, for Search"
}

Attempt to reindex:

www-data@magento2-cron:~/magento$ php bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search index has been rebuilt successfully in 00:00:02
| improve this answer | |
  • 1
    It works for catalogsearch_fultext but failed for catalog_product. Have installed elasticsearch2.4.1 but same result "Product Indexed Processing product 7272 Product marked disabled because not category found." "ElasticSuite Category Indexing indexer process unknown error: {"error":{"root_cause":[{"type":"index_creation_exception","reason":"failed to create index"}],"type":"illegal_argument_exception","reason":"Unknown TokenFilter type [phonetic] for [phonetic]"},"status":400} ElasticSuite Thesaurus Indexing index has been rebuilt successfully in 00:00:01" – insoftservice Feb 16 '19 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.