lib/redi_search_rails.rb
def ft_sugadd (record:, attribute:, score: 1)
      # => combine model with attribute to create unique key like user_name
      key = "#{@model.to_s}:#{attribute}"
      string = record.send(attribute)
      REDI_SEARCH.call('FT.SUGADD', key, string, score)
      # => INCR
    rescue Exception => e
      Rails.logger.error e if defined? Rails
      return e.message
    end
def ft_sugadd (record:, attribute:, score: 1)
      # => combine model with attribute to create unique key like user_name
      key = "#{@model.to_s}:#{attribute}"
      string = record.send(attribute)
      REDI_SEARCH.call('FT.SUGADD', key, string, score)
      # => INCR
    rescue Exception => e
      Rails.logger.error e if defined? Rails
      return e.message
    end
def ft_sugadd ( record : , attribute : , score : 1 ) # => combine model with attribute to create unique key like user_name key = "#{@model.to_s}:#{attribute}" string = record . send ( attribute ) REDI_SEARCH . call ( 'FT.SUGADD' , key , string , score ) # => INCR rescue Exception => e Rails . logger . error e if defined? Rails return e . message end
add string to autocomplete dictionary

 @param record [Object] object
 @param attribute [String] - name, email, etc
 @param score [Integer] - score
 @return [Integer] - current size of the dictionary
add string to autocomplete dictionary