Suggest user profile API

edit

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.

Request

edit

GET /_security/profile/_suggest

POST /_security/profile/_suggest

Prerequisites

edit

To use this API, you must have the manage_user_profile cluster privilege.

Query parameters

edit
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 body

edit
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 body

edit
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.

Examples

edit

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"
      }
    }
  ]
}