solr-protolib/src/main/java/com/streamsets/pipeline/stage/destination/solr/SolrTarget.java
private boolean checkRecordContainsSolrFields(
      Map<String, Field> recordFieldMap,
      Record record,
      List<String> solrFieldsMap,
      Errors errorToThrow
  ) throws StageException {
    // for (Map.Entry<String, Field> recordFieldMapEntry : recordFieldMap.entrySet())
    List<String> fieldsFound = new ArrayList<>();

    recordFieldMap.keySet().forEach(recordFieldKey -> {
      if (solrFieldsMap.contains(recordFieldKey)) {
        fieldsFound.add(recordFieldKey);
      }
    });

    // if record does not contain solr fields then process error accordingly
    if (solrFieldsMap.size() != fieldsFound.size()) {
      Set<String> missingFields = new HashSet<>();
      solrFieldsMap.forEach(requiredField -> {
        if (!fieldsFound.contains(requiredField)) {
          missingFields.add(requiredField);
        }
      });

      handleError(record, errorToThrow, Joiner.on(",").join(missingFields));

      return false;
    }

    return true;
  }
private boolean checkRecordContainsSolrFields(
      Map<String, Field> recordFieldMap,
      Record record,
      List<String> solrFieldsMap,
      Errors errorToThrow
  ) throws StageException {
    // for (Map.Entry<String, Field> recordFieldMapEntry : recordFieldMap.entrySet())
    List<String> fieldsFound = new ArrayList<>();

    recordFieldMap.keySet().forEach(recordFieldKey -> {
      if (solrFieldsMap.contains(recordFieldKey)) {
        fieldsFound.add(recordFieldKey);
      }
    });

    // if record does not contain solr fields then process error accordingly
    if (solrFieldsMap.size() != fieldsFound.size()) {
      Set<String> missingFields = new HashSet<>();
      solrFieldsMap.forEach(requiredField -> {
        if (!fieldsFound.contains(requiredField)) {
          missingFields.add(requiredField);
        }
      });

      handleError(record, errorToThrow, Joiner.on(",").join(missingFields));

      return false;
    }

    return true;
  }
Checks whether the record contains solr fields in solrFieldsMap or not.

@param recordFieldMap Fields contained in the reocrd
@param record The whole record
@param solrFieldsMap Solr fields that will be searched in record fields
@param errorToThrow error to use if missing Solr fields are detected
@return true if record contains all solr fields in solrFieldsMap otherwise false
@throws StageException Exception thrown by handleError method call