anchor.diff:        target   = $(e.currentTarget)
         p = target.val() || ""
         base_id = target.attr('id').slice(0, -1)
  -      query_input = $('input#' + base_id + "v_0_value")
  +      query_input = $("input##{base_id}v_0_value")
   
         # We need to use a dummy input to handle multiple terms
         multi_id = query_input.attr('id') + '_multi'
  -      multi_input = @element.find('#' + multi_id)
  +      multi_input = @element.find("##{multi_id}")
   
         if Select2?
           # Turn query input into Select2 tag list when query accepts multiple values
  
positive.code:       else
          predicate_select2.show()
          # If Select2 is on query input, remove and set defaults
          if query_select2 = @element.find('#s2id_' + base_id + 'v_0_value')
            query_input.select2('destroy')
            query_input.val('')
            previous_val = ''
  
negative.code: 
        # Fetch all query inputs for condition
        base_name = target.data('base-name')
        inputs = @element.find("input[name^=\"#{base_name}\"]")
  
        # Set the original query input to the first value before shifting inputs and values
        $(inputs[0]).val(e.val[0])
  