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

Xon

Well-known member
Affected version
2.2.13
If the c.prefixes query parameter has the value c[prefixes][10]=1&c[prefixes][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;
PHP:
		$prefixes = $request->filter('c.prefixes', 'array-uint');
		$prefixes = array_unique($prefixes);
		if ($prefixes && reset($prefixes))
		{
			$query->withMetadata('prefix', $prefixes);
		}
The line $prefixes = array_unique($prefixes); should be $prefixes= array_unique(array_values($prefixes));.
 
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.14).

Change log:
Ensure prefix search constraints are lists of values
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom