This looks very similar to the code above, and could possibly go in a function.  There might be one already

expandRecord(keyedSourceFields, source->queryNormalizedSelector(), searchRecord)?