How do you filter a query with elasticsearch-rails gem?
Try this format:
Elasticsearch v2.4
@customers = Customer.__elasticsearch__.search( query: { bool: { filter: { term: {"account_id" => current_account.id.to_s} }, must: { query_string: { query: "*#{params[:q]}*" } } }, }, size: options[:per_page], from: options[:from] ).records
have you tried
@pieces = Piece.search(params[:q]).records.where(published: true)
it works on one of my ES models