salyh/elasticsearch-river-imap — pull request #9 by hansjorg (2014-07-08 22:07:18+00:00)
Title: Create typemapping even if index already exists

When creating a river with an existing index (given by mail_index_name), creation of the mail type mapping is skipped.

This results in the fields being dynamically mapped, causing the "flaghashcode" field to be mapped as a long. The next time indexing runs, an exception is thrown for every previously indexed mail since no integer flaghashcode is found.

I've split index and type mapping creation and added an exists check for the type mapping as well, ensuring that the flaghashcode is mapped as an integer.