anchor.diff:              if results.Meta.RecordsReturned > 1 then 
                   !>"Duplicate Found"
                   let header = 
  -                    new SourceRecord(session.SessionId, SourceRecordId = record.[Constants.IdField], SourceDisplayName = record.[session.DisplayFieldName])
  +                    new SourceRecord(session.SessionId, SourceRecordId = record.[Constants.IdField], 
  +                                     SourceDisplayName = record.[session.DisplayFieldName])
                   let docs = results |> toFlatResults
                   let mutable i = 1
                   for result in docs.Documents do
  
positive.code:     member val IndexName = defString with get, set
      member val ProfileName = defString with get, set
      member val MaxRecordsToScan = Int16.MaxValue with get, set
      member val NextId = new AtomicLong(0L) with get
      override this.Validate() = ok()
  
  [<AutoOpen>]
  
negative.code:             builder |> addElement (EndTable)
          (builder.ToString(), aggrBuilder.ToString())
      
      let getFileDataSource (request : DuplicateDetectionReportRequest) = 
          use reader = new TextFieldParser(request.SourceFileName)
          reader.TextFieldType <- FieldType.Delimited
          reader.SetDelimiters([| "," |])
          reader.TrimWhiteSpace <- true
          let headers = reader.ReadFields()
          
          let data = 
              seq { 
                  while not reader.EndOfData do
                      yield reader.ReadFields()
              }
          (headers, data)
      
      let getIndexDataSource (request : DuplicateDetectionReportRequest) = 
          let mainQuery = 
              new SearchQuery.Dto(request.IndexName, request.SelectionQuery, Count = int Int16.MaxValue, 
                                  ReturnFlatResult = true, Columns = [| "*" |])
          let result = searchService.Search(mainQuery)
          match result with
          | Choice1Of2(result) -> 
              let headers = 
                  searchService.Search(new SearchQuery.Dto(request.IndexName, request.SelectionQuery, Count = 1, ReturnFlatResult = true, Columns = [| "*" |]))
                  |> extract |> toFlatResults 
                  |> fun x -> 
                      let d = x.Documents.ToList().First()
                      d.Keys.ToArray()
  
              (!>) "Main Query Records Returned:%i" result.Meta.RecordsReturned
              let records = result |> toFlatResults
              let d = seq {
                  for record in records.Documents do
                      yield record.Values.ToArray()
              }
              (headers, d)
          | Choice2Of2(err) -> 
              Logger.Log(err)
              (Array.empty, Seq.empty)
          
      let getDataSource (request : DuplicateDetectionReportRequest) = 
          if isNotBlank request.SourceFileName then getFileDataSource (request)
          else getIndexDataSource (request)
      
      let generateReport (jobId, request : DuplicateDetectionReportRequest) = 
          let (headers, data) = getDataSource(request)
          let stats = new Stats()
          let builder = new StringBuilder()
          let aggrBuilder = new StringBuilder()
  