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.

Requestedit

GET /_security/profile/_suggest

POST /_security/profile/_suggest

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, use data=*. To return a subset of content, use data=<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 and email.
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"
      }
    }
  ]
}