code: public void setSimilarityClass(String className)
     {
        try
        {
           Class<?> similarityClass = ClassLoading.forName(className, this);
           similarity = (Similarity)similarityClass.newInstance();
        }
        catch (ClassNotFoundException e)
        {
           log.warn("Invalid Similarity class: " + className, e);
        }
        catch (InstantiationException e)
        {
           log.warn("Invalid Similarity class: " + className, e);
        }
        catch (IllegalAccessException e)
        {
           log.warn("Invalid Similarity class: " + className, e);
        }
     }
docs: Sets the similarity implementation, which will be used for indexing and
  searching. The implementation must extend {@link Similarity}.
  
  @param className
  a {@link Similarity} implementation.