code: private void addFieldsToBuilder(String[] fieldsToSelect, Class clazz, MetamodelImpl metaModel,
              SearchRequestBuilder builder)
      {
          if (fieldsToSelect != null && fieldsToSelect.length > 1 && !(fieldsToSelect[1] == null))
          {
              logger.debug("Fields added in query are: ");
              for (int i = 1; i < fieldsToSelect.length; i++)
              {
                  logger.debug(i + " : " + fieldsToSelect[i]);
                  builder = builder.addField(((AbstractAttribute) metaModel.entity(clazz).getAttribute(fieldsToSelect[i]))
                          .getJPAColumnName());
              }
          }
      }
docs: Adds the fields to builder
  
  @param fieldsToSelect
  the fields to select
  @param clazz
  the clazz
  @param metaModel
  the meta model
  @param builder
  the builder