diff --git a/elasticsearch-model/lib/elasticsearch/model/multimodel.rb b/elasticsearch-model/lib/elasticsearch/model/multimodel.rb index 2c2306274..f9ef2eaea 100644 --- a/elasticsearch-model/lib/elasticsearch/model/multimodel.rb +++ b/elasticsearch-model/lib/elasticsearch/model/multimodel.rb @@ -85,7 +85,7 @@ def index_name # @return [Array] the list of document types used for retrieving documents # def document_type - models.map { |m| m.document_type } + models.map { |m| m.document_type }.compact.presence end # Get the client common for all models