Checks for and creates index and mapping. fixes #5