<commit_before>class MerchantsController < ApplicationController
  before_action :set_merchant, only: [:show, :edit, :update, :destroy, :map]

  # GET /search
  def search
    @selected_category_id = params[:category]
    @merchants = Category.find(params[:category]).merchants
    @categories = Category.all
    render 'search_results'
  end

  # GET /merchants
  # GET /merchants.json
  def index
    @merchants = Merchant.all
  end

  # GET /merchants/1<commit_msg>amend the search function in the merchant controller to include location<commit_after>class MerchantsController < ApplicationController
  before_action :set_merchant, only: [:show, :edit, :update, :destroy, :map]

  # GET /search
  def search
    @selected_category_id = params[:category]
    @selected_location_id = params[:location]
    @merchants = Merchant.where(category_id: params[:category], location_id: params[:location])
    @categories = Category.all
    @locations = Location.all
    render 'search_results'
  end

  # GET /merchants
  # GET /merchants.json
  def index
    @merchants = Merchant.all
  end

  # GET /merchants/1
{'fraction_non_alphanumeric': 0.1020776874435411, 'fraction_numerical': 0.0018066847335140017, 'mean_word_length': 4.12962962962963, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1199367', 'n_tokens_mistral': 352, 'n_tokens_neox': 344, 'n_words': 86}