Fixed Search sends a node-list as a hash and not an array to search subsystem


Well-known member
Affected version
2.2.7 Patch 1
If the c.nodes query parameter has the value c[nodes][10]=1&c[nodes][11]=2, and XFES is installed, elasticsearch can throw something like "Elasticsearch error: [terms] query does not support [0] within lookup element".

This happens because of this code;
$nodeIds = $request->filter('c.nodes', 'array-uint');
$nodeIds = array_unique($nodeIds);
if ($nodeIds && reset($nodeIds))
   if ($request->filter('c.child_nodes', 'bool'))
   $query->withMetadata('node', $nodeIds);
The line $nodeIds = array_unique($nodeIds); should be $nodeIds = array_unique(array_values($nodeIds)); or similar.

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.8).

Change log:
Ensure node ID constraints are always in a numerical array when searching for posts
There may be a delay before changes are rolled out to the XenForo Community.