Fixed Enhanced Search 1.1.7 PHP < 5.4 compatibility issue

Mike

XenForo developer
Staff member
Affected version
1.1.7
Enhanced Search 1.1.7 accidentally uses a construct that requires PHP 5.4 or newer. If you are running an older version, you'll receive a parse error in library/XenES/Model/Elasticsearch.php.

To fix this, in the mentioned file, change:
Code:
public function createOptimizedIndex($indexName, array $settings = [], $deleteFirst = true)
to:
Code:
public function createOptimizedIndex($indexName, array $settings = array(), $deleteFirst = true)

Then change:
Code:
$mapping['properties']['type'] = ['type' => 'keyword'];
to:
Code:
$mapping['properties']['type'] = array('type' => 'keyword');

Alternatively, using a newer PHP version is strongly recommended.
 
Last edited:
Back
Top Bottom