'How to use elasticsearch query with searchUsers function in Kuzzle?

i set a property called type in some users with the kuzzle console, now i want to search for user who have the type set to user so i use a query for searching user. Here is my code:

const resultUsers = await kuzzle.security.searchUsers({
  query: {
    term: {
      type: "user"
    }
  }
})
console.log(resultUsers)

I also tried with this query too:

query: {
  term: {
    "content.type": "user"
  }
}

and this one:

query: {
  term: {
    "_source.type": "user"
  }
}

But the function always return 0 users. Can someone explain me why please ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source