Added automatic id generation support for bulk

Without this commit you can't omit id when using bulk.
You get a document in the index with an _id field with the value "".

This commit fixed this and really omits the _id field when empty.