def find(*ids)
      results = chain { criteria.update_options simple: true }.filter { _id == ids.flatten }.to_a

      raise Chewy::DocumentNotFound, "Could not find documents for ids #{ids.flatten}" if results.empty?
      ids.one? && !ids.first.is_a?(Array) ? results.first : results
    end
def find(*ids)
      results = chain { criteria.update_options simple: true }.filter { _id == ids.flatten }.to_a

      raise Chewy::DocumentNotFound, "Could not find documents for ids #{ids.flatten}" if results.empty?
      ids.one? && !ids.first.is_a?(Array) ? results.first : results
    end
Find all documents matching a query.

 @example
   UsersIndex.find(42)
   UsersIndex.filter{ age <= 42 }.find(42)
   UsersIndex::User.find(42)
   UsersIndex::User.filter{ age <= 42 }.find(42)

 In all the previous examples find will return a single object.
 To get a collection - pass an array of ids.

 @example
    UsersIndex::User.find(42, 7, 3) # array of objects with ids in [42, 7, 3]
    UsersIndex::User.find([8, 13])  # array of objects with ids in [8, 13]
    UsersIndex::User.find([42])     # array of the object with id == 42