Issue 331 performance es refresh

See #331.

The elasticsearch index is set to no refresh while indexing. When indexing is finished, the index is set to refresh and optimize.