You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: filter.rb
    path of file: ./repos/chewy/lib/chewy/search/parameters
    
    the code of the file until where you have to start completion: require 'chewy/search/parameters
    
        def filter_query(value)
          bool = value[:bool] if value
          if bool && bool[:must].present? && bool[:should].blank? && bool[:must_not].blank?
            bool[:must]
          else
            value
          end