0

I have an M2 with Elasticsearch installed, with the Smile/Elasticsuite module.

These are my versions in composer.json:

"smile/elasticsuite": "2.5.15",
"elasticsearch/elasticsearch": "^2.2.3"

And in all the category pages, I have this error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /vendor/smile/elasticsuite/src/module-elasticsuite-virtual-category/Model/Layer/Filter/Category.php on line 153

There are the two lines related with this error :

$virtualRule = $category->getVirtualRule();
$data = call_user_func_array([$virtualRule, $callback], [$category]);

Somehow, the $virtualRule variable is NULL, and the function call_user_func_array doesn't like this if someone already saw this thing.

Feel free to answer, thanks!

2
  • Also, what Magento version are you using?
    – Greg
    Oct 26, 2018 at 15:12
  • 1
    I am on 2.2.5, but now it's working with theses versions : "elasticsearch/elasticsearch" : "5.3.2" "smile/elasticsuite" : "2.6.2" and elasticsearch local (with brew) now on version 5.6.12
    – Yoan
    Oct 26, 2018 at 15:59

1 Answer 1

0

You have installed ElasticSearch version is "number" : "2.2.3". In order to make it work with Magento 2.2.x and ElasticSuite 2.5.x you need to install ElasticSearch 6.x. Make sure to install the correct version of ElasticSearch.

I am actually using Elasticsearch 5.x series and it seems to be working with no issues.

My curl result:

{
  "name" : "ARXtHgF",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "0L1pnmTiQBaWL21J5p5iPw",
  "version" : {
    "number" : "5.6.12",
    "build_hash" : "cfe3d9f",
    "build_date" : "2018-09-10T20:12:43.732Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}
10
  • Alright thanks I'll try, what is your Magento version btw ? And you have no problem with reindexing ? Cause when I use ElasticSuite 2.6.x, I don't have the issue above on my category page, but I'm unable to complete the reindex because of this : No handler for type [text] declared on field [search]
    – Yoan
    Oct 26, 2018 at 14:49
  • I am using Magento 2.2.4. Also, I had the same problem when trying to reindex (No handler for type [text] declared on field [search]) and when upgraded the Elasticsearch, the error was gone ;)
    – Greg
    Oct 26, 2018 at 14:52
  • oh ! you upgraded to which version precisely ? I have 5.3.2 now and I still have the reindexing problem :/
    – Yoan
    Oct 26, 2018 at 14:56
  • I have 5.6.12 and it's working with no issues ;) Do you get the same error when running bin/magento setup:upgrade?
    – Greg
    Oct 26, 2018 at 14:59
  • oh you're talking about you're Elasticsearch on your machine ! I was talking about my composer version, which is v5.3.2 and the next one available after that is v6.0.0. Anyway, I don't have this issue when I use the "upgrade" command, and on my machine (the number version when I use the curl command) is 2.4.6, I think I should upgrade this one too ! But just to be sure, can you tell me exactly your composer version of elasticsearch/elasticsearch and smile/elasticsuite please :)
    – Yoan
    Oct 26, 2018 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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