def valid_query?(query)
      raise ArgumentError, "Query cannot be nil or empty" if query.to_s.empty?

      # Attempt to create a search query parser
      search = FoodCritic::Chef::Search.new
      search.create_parser(search.chef_search_grammars)

      if search.parser?
        search.parser.parse(query.to_s)
      else
        # If we didn't manage to get a parser then we can't know if the query
        # is valid or not.
        true
      end
    end
def valid_query?(query)
      raise ArgumentError, "Query cannot be nil or empty" if query.to_s.empty?

      # Attempt to create a search query parser
      search = FoodCritic::Chef::Search.new
      search.create_parser(search.chef_search_grammars)

      if search.parser?
        search.parser.parse(query.to_s)
      else
        # If we didn't manage to get a parser then we can't know if the query
        # is valid or not.
        true
      end
    end
Is this a valid Lucene query?