Method: XapianDb::Config#indexer_preprocess_callback

Defined in:
lib/xapian_db/config.rb

#indexer_preprocess_callback(method) ⇒ Object

Set the indexer preprocess callback.

Examples:

class Util
  def self.strip_accents(terms)
    terms.gsub(/[éèêëÉÈÊË]/, "e")
  end
end

XapianDb::Config.setup do |config|
  config.indexer_preprocess_callback Util.method(:strip_accents)
end

Parameters:

  • method (Method)

    a class method; needs to take one parameter and return a string.



219
220
221
# File 'lib/xapian_db/config.rb', line 219

def indexer_preprocess_callback(method)
  @_preprocess_terms = method
end