Serialize relevant documents for indexing
Set memory limit for commands
Fix bug duplicate documents added and use config for hit threshold