Fixed a bug where indexer is being run on non-documents, added configurable behavior to indexer