I'm using Search API Solr with custom searches in code, but I want to find a way to limit the return results to only the nid to save on bandwidth with our third-party solr server. I've tried $query->fields(array('nid')) but I receive the following error.
SearchApiException: Trying to search on field nid which is no indexed fulltext field.
I am using the following code (simplified).
$index = search_api_index_load('my_index');
$query = $index->query();
$query->keys($search_terms);
$query->fields(array('nid')); // doesn't work
$results = $query->execute();
return $results;
How do I get only node IDs from $results
?