anchor.diff:          assert (queryTypes.Count > 0)
           let rec generateQuery (pred : Predicate) = 
               maybe { 
  -                let validateFieldExists (f) =
  +                let validateFieldExists (f) = 
                       match fields.TryGetValue(f) with
                       | true, a -> ok (a)
                       | _ -> fail (KeyNotFound(f))
  +                
                   let generateMatchAllQuery = ref false
                   match pred with
                   | NotPredicate(pr) -> 
  
positive.code:             }
          generateQuery predicate
      
      let private Search(flexIndex : Index.T, query : Query, search : SearchQuery.T) = 
          let indexSearchers = new List<IndexSearcher>()
          for i in 0..flexIndex.Shards.Length - 1 do
              let searcher = (flexIndex.Shards.[i].SearcherManager :> ReferenceManager).Acquire() :?> IndexSearcher
              indexSearchers.Add(searcher)
          // Each thread only works on a separate part of the array and as no parts are shared across
          // multiple threads the below variables are thread safe. The cost of using blocking collection vs. 
          // array per search is high
          let topDocsCollection : TopDocs array = Array.zeroCreate indexSearchers.Count
          
          let sort = 
              match search.OrderBy with
              | null -> Sort.RELEVANCE
              | _ -> 
                  match flexIndex.IndexSetting.FieldsLookup.TryGetValue(search.OrderBy) with
                  | (true, field) -> new Sort(new SortField(field.SchemaName, FlexFieldType.sortField (field.FieldType)))
                  | _ -> Sort.RELEVANCE
          
          let count = 
  
negative.code:                 for hit in hits do
                      if search.Skip > 0 && skipped.Value < search.Skip then skipped.Value <- skipped.Value + 1
                      else 
                          let document = indexSearchers.[hit.ShardIndex].IndexSearcher.Doc(hit.Doc)
                          let fields = GetDocument(indexWriter, search, document)
                          
                          let resultDoc : Document.T = 
                              { Id = document.Get(indexWriter.Settings.FieldsLookup.[Constants.IdField].SchemaName)
                                IndexName = indexWriter.Settings.IndexName
                                TimeStamp = 
                                    int64 
                                        (document.Get
                                             (indexWriter.Settings.FieldsLookup.[Constants.LastModifiedField].SchemaName))
                                Fields = fields
                                Score = 
                                    if search.ReturnScore then float (hit.Score)
                                    else 0.0
                                Highlights = null }
                          if highlighterOptions.IsSome then 
                              let (field, highlighter) = highlighterOptions.Value
                              let text = document.Get(field.SchemaName)
                              if text <> null then 
                                  let tokenStream = 
                                      TokenSources.GetAnyTokenStream
                                          (indexSearchers.[hit.ShardIndex].IndexReader, hit.Doc, field.SchemaName, 
                                           indexWriter.Settings.SearchAnalyzer)
                                  let frags = 
                                      highlighter.GetBestTextFragments
                                          (tokenStream, text, false, search.Highlights.FragmentsToReturn)
                                  for frag in frags do
                                      if frag <> null && frag.GetScore() > float32 (0) then 
                                          resultDoc.Highlights.Add(frag.ToString())
                          yield resultDoc
              }
          for i in 0..indexSearchers.Length - 1 do
              (indexSearchers.[i] :> IDisposable).Dispose()
          Choice1Of2(results, recordsReturned, totalAvailable)
      
      let SearchDictionarySeq(indexWriter : IndexWriter.T, query : Query, search : SearchQuery.T) = 
          let (hits, _, recordsReturned, totalAvailable, indexSearchers) = Search(indexWriter, query, search)
          let skipped = ref 0
          
          let results = 
  