anchor.diff:  
   module DocumentService = 
       /// Get a document by Id
  -    let getDocument (indexName) (id) (state : State.T) = ()
  +    let getDocument (indexName) (id) (searchService : ISearchService) = 
  +        maybe { 
  +            let q = new SearchQuery.Dto(indexName, (sprintf "%s = '%s'" Constants.IdField id))
  +            q.ReturnScore <- false
  +            q.ReturnFlatResult <- false
  +            q.Columns.Add("*")
  +            match searchService.Search(q) with
  +            | Choice1Of2(v') -> 
  +                if v'.Documents.Count <> 0 then return! Choice1Of2(v'.Documents.First())
  +                else return! fail <| DocumentIdNotFound(indexName, id)
  +            | Choice2Of2(e) -> return! Choice2Of2(e)
  +        }
       
       /// Get top 10 document from the index
  -    let getDocuments (indexName) (state : State.T) = ()
  +    let getDocuments (indexName) (count) (searchService : ISearchService) = 
  +        maybe { 
  +            let q = new SearchQuery.Dto(indexName, (sprintf "%s matchall 'x'" Constants.IdField))
  +            q.ReturnScore <- false
  +            q.ReturnFlatResult <- false
  +            q.Columns.Add("*")
  +            q.Count <- count
  +            q.MissingValueConfiguration.Add(Constants.IdField, MissingValueOption.Ignore)
  +            return! searchService.Search(q)
  +        }
       
       /// Add or update an existing document
       let addOrUpdateDocument (document : Document.Dto) (state : State.T) = 
  
positive.code: /// Document related operations
  type IDocumentService = 
      abstract GetDocument : indexName:string * id:string -> Choice<Document.Dto, Error>
      abstract GetDocuments : indexName:string * count:int -> Choice<Document.Dto, Error>
      abstract AddOrUpdateDocument : document:Document.Dto -> Choice<unit, Error>
      abstract DeleteDocument : indexName:string * id:string -> Choice<unit, Error>
      abstract AddDocument : document:Document.Dto -> Choice<CreateResponse, Error>
  
negative.code:     
      /// Check if a given index exists
      let indexExists (indexName) (state : T) = state.IndexFactory |> LazyFactory.exists indexName indexNotFound
      
      /// Checks if a given index exists and returns the state of the index if it exists
      let indexExists2 (indexName) (state : T) = 
          match state.IndexFactory |> LazyFactory.getState indexName with
          | Choice1Of2(state) -> ok <| state
          | Choice2Of2(_) -> fail <| IndexNotFound indexName
      
      /// Checks if a given index is online or not. If it is online then return the index writer    
      let indexOnline (indexName) (state : T) = 
          match state |> indexExists2 indexName with
          | Choice1Of2(indexState) -> 
              if indexState = IndexState.OnlineMaster then ok <| (state.IndexFactory.ObjectStore.[indexName].Value.Value)
              else fail <| IndexShouldBeOnline(indexName)
          | Choice2Of2(error) -> fail <| error
  
  module IndexService = 
      /// Returns IndexNotFound error
  