Limiting search results to current_user

I am pretty new to Rails and ES. I have a query that was working and now I want to limited the results to only the current_user but I am having trouble with what to include in my controller.

It doesn't like the where method - thanks for any help

@galleries = Gallery.search params[:q], where: {user_id: current_user.id}

	def self.search(query, user_id)
    __elasticsearch__.search(
      {
         query: {
           bool: {
             must: [{
              multi_match: {
                query: query,
                fields: ['name', 'memory', 'memory_date']
              }
            }],
            filter: [{
              term: {"user_id" => user_id}
            }]
          }
        }
   }
)
end

If you could reproduce it with a curl recreation that'd be easier.

Here, the query looks good.

But as we don't know your documents, your mapping, the exact queries, that's hard to say.