Do not index a document multiple times to a layer identifier.

Issue #189