You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to get relevant user search results, we used 'orderby' => 'relevance' in WP_User_Query
But I would like to use other sorting options as well.
quote from documentation "You can sort by multiple fields as well i.e. title meta.my_key.raw"
'orderby' => 'relevance meta.my_key.long',
Only one sort option works.
If you specify two parameters, we get a 400 error. "Query Response Code: HTTP 400"
'orderby' => 'display_name meta.user_points.long'
In this case, there are no errors 400. But the issuance is not at all what you need.
Sorting on the numerical field meta.user_points.long does not occur
Even if you use it 'orderby' => 'display_name relevance',
The only James Bond is on the 3rd page page. The results are no rrelevant.
In order for the search results to match the search query, you should use only one sorting option 'orderby' => 'relevance'
The other sorting options do not work if you use two keys.
'orderby' => 'meta.user_points.long'
or sorting by numeric field, it also works only if there is one key
Hi there.
In order to get relevant user search results, we used 'orderby' => 'relevance' in WP_User_Query
But I would like to use other sorting options as well.
quote from documentation "You can sort by multiple fields as well i.e. title meta.my_key.raw"
'orderby' => 'relevance meta.my_key.long',
Only one sort option works.
If you specify two parameters, we get a 400 error. "Query Response Code: HTTP 400"
Error:
{
"error": {
"root_cause": [
{
"type": "query_shard_exception",
"reason": "No mapping found for [title] in order to sort on",
"index_uuid": "IV7U_v67T0-abeNgmVWPfw",
"index": "devsite-user"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "can_match",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "devsite-user",
"node": "-vua6l6HSJesVPT9PmU8uA",
"reason": {
"type": "query_shard_exception",
"reason": "No mapping found for [title] in order to sort on",
"index_uuid": "IV7U_v67T0-abeNgmVWPfw",
"index": "devsite-user"
}
}
]
},
"status": 400
}
Separate - works
'orderby' => 'meta.user_points.long'
or
'orderby' => 'relevance'
The text was updated successfully, but these errors were encountered: