groonga: Extract method to convert query/filter to condition