All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codelibs.opensearch.minhash.MinHashPlugin Maven / Gradle / Ivy

package org.codelibs.opensearch.minhash;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.codelibs.opensearch.minhash.index.analysis.MinHashTokenFilterFactory;
import org.codelibs.opensearch.minhash.index.mapper.MinHashFieldMapper;
import org.opensearch.index.analysis.TokenFilterFactory;
import org.opensearch.index.mapper.Mapper;
import org.opensearch.indices.analysis.AnalysisModule.AnalysisProvider;
import org.opensearch.plugins.AnalysisPlugin;
import org.opensearch.plugins.MapperPlugin;
import org.opensearch.plugins.Plugin;

public class MinHashPlugin extends Plugin implements MapperPlugin, AnalysisPlugin {

    @Override
    public Map> getTokenFilters() {
        final Map> extra = new HashMap<>();
        extra.put("minhash", MinHashTokenFilterFactory::new);
        return extra;
    }

    @Override
    public Map getMappers() {
        return Collections. singletonMap(MinHashFieldMapper.CONTENT_TYPE, new MinHashFieldMapper.TypeParser());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy