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

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

Discussion in 'Enhanced Search Resolved Bugs' started by Mike, Apr 22, 2014.

  1. Mike

    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.
     
    Joshua and MattW like this.
  2. Joshua

    Joshua Active Member

    Thank you Mike, it works! :)
     
  3. surfsup

    surfsup Well-Known Member

    Will these be resolved in the future enhanced search 1.1 version?
     

Share This Page