Fixed Display results as threads / advanced filters in ES 1.0+

Mike

XenForo developer
Staff member
Further backwards compatibility breaks in elasticsearch 1.0/1.1 have been identified that interfere with displaying search results as threads and some other advanced filters. This is due to the return structure of the results changing.

The proper fix is more complicated than what I'm posting here, but if you are running ES 1.0 or newer, you can apply this change manually. If you are running 0.90 or older, don't make these changes.

In library/XenES/Search/SourceHandler/ElasticSearch.php, look for:
Code:
$groupId = (isset($result->fields->discussion_id) ? intval($result->fields->discussion_id) : 0);
Change it to:
Code:
$groupId = (isset($result->fields->discussion_id[0]) ? intval($result->fields->discussion_id[0]) : 0);

Look for:
Code:
. ', ' . $db->quote($hit->fields->user) . ', ' . $db->quote($hit->fields->date)
. ', ' . $db->quote($hit->fields->discussion_id) . ')';
Change it to:
Code:
. ', ' . $db->quote($hit->fields->user[0]) . ', ' . $db->quote($hit->fields->date[0])
. ', ' . $db->quote($hit->fields->discussion_id[0]) . ')';
To confirm the change works, run a search where the results are displayed as threads and a minimum replies filter is applied.
 
Top Bottom