fix bug - createDocument was called from indexer instead of IRDoc
Added doc ref count