Add support for document_type filter

Allow filtering by elasticsearch's _type field. This will be used for finder-frontend.
Um: attributes is a misleading name and introduced in this commit.  I'd prefer it to be corrected before merge.