A sample indexer for elastic search and minor refactoring