Search user by field value using Drupal Search Api I have a set of users with field_first_name and field_last_name, and i want to create a user search using the search api, to search for users using those fields, but it doesn't seems to be working.

Here is my code:

$query = Index::load('default_index')
      -&gt;query(array(
          'offset' =&gt; 0,
          'limit'  =&gt; 12,
      ))
      -&gt;keys($text)
      -&gt;addCondition('search_api_datasource', 'entity:user')
      -&gt;execute();


It's not fetching any of my users per name. I am missing something?
On the first hand, can you check if your content is being indexed properly ?
If yes, then I would recommend using the default search box provided by drupal, and see if you get results.

Assuming you are using search api solr module.