• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Enhanced Search 1.1.7 PHP < 5.4 compatibility issue

Affected version
1.1.7

Mike

XenForo developer
Staff member
#1
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: