Search in sources :

Example 1 with SimilarityPlugin

use of com.yelp.nrtsearch.server.plugins.SimilarityPlugin in project nrtsearch by Yelp.

the class SimilarityCreator method initialize.

/**
 * Initialize singleton instance of {@link SimilarityCreator}. Registers all the standard
 * similarity implementations and any additional provided by {@link SimilarityPlugin}s.
 *
 * @param configuration service configuration
 * @param plugins list of loaded plugins
 */
public static void initialize(LuceneServerConfiguration configuration, Iterable<Plugin> plugins) {
    instance = new SimilarityCreator(configuration);
    for (Plugin plugin : plugins) {
        if (plugin instanceof SimilarityPlugin) {
            SimilarityPlugin similarityPlugin = (SimilarityPlugin) plugin;
            instance.register(similarityPlugin.getSimilarities());
        }
    }
}
Also used : SimilarityPlugin(com.yelp.nrtsearch.server.plugins.SimilarityPlugin) Plugin(com.yelp.nrtsearch.server.plugins.Plugin) SimilarityPlugin(com.yelp.nrtsearch.server.plugins.SimilarityPlugin)

Aggregations

Plugin (com.yelp.nrtsearch.server.plugins.Plugin)1 SimilarityPlugin (com.yelp.nrtsearch.server.plugins.SimilarityPlugin)1