Time for action – projecting fields with fl
Another important parameter to consider is
fl, that can be used for fields projection, obtaining only certain fields in the results:
If we are interested on obtaining the titles and artist reference for all the documents, we can use the following command:
>>curl -X GET 'http://localhost:8983/solr/paintings/select?q=artist:*&wt=json&indent=true&omitHeader=true&fl=title,artist'
The output for the command is similar to the one shown in the following screenshot:
- Notice that the results will be indented as requested, and they will not contain any header to be more readable. Moreover, the parameters list does ...