IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Suggest user profile APIedit
This feature is in development and not yet available for use. This documentation is provided for informational purposes only.
Get suggestions for user profiles that match specified search criteria.
Prerequisitesedit
To use this API, you must have the manage_user_profile
cluster privilege.
Query parametersedit
-
data
-
(Optional, string) Comma-separated list of filters for the
data
field of the profile document. To return all content, usedata=*
. To return a subset of content, usedata=<key>
to retrieve the content nested under the specified<key>
. Defaults to returning no content.
Request bodyedit
-
name
-
(Optional, string)
Query string used to match name-related fields in user profile documents. Name-related fields are the user’s
username
,full_name
andemail
. -
size
-
(Optional, integer)
Number of profiles to return. Defaults to
10
.
Response bodyedit
-
total
- (object) Metadata about the number of matching profiles.
-
took
- (integer) Milliseconds it took Elasticsearch to execute the request.
-
profiles
- (array of objects) List of profile documents, ordered by relevance, that match the search criteria.
Examplesedit
The following request get suggestions for profile documents with name-related fields
matching jack
:
POST /_security/profile/_suggest { "name": "jack" }
The API returns:
{ "total": { "value": 1, "relation": "eq" }, "took": 42, "profiles": [ { "uid": "u_kd2JMqwUQwSCCOxMv7M1vw", "user": { "username": "jacknich", "full_name": "Jack Nicholson", "email": "jacknich@example.org", "roles": [ "admin", "other_role1" ], "realm_name": "native1" } } ] }