Search in sources :

Example 1 with JavabinLoader

use of org.apache.solr.handler.loader.JavabinLoader in project lucene-solr by apache.

the class UpdateRequestHandler method createDefaultLoaders.

protected Map<String, ContentStreamLoader> createDefaultLoaders(NamedList args) {
    SolrParams p = null;
    if (args != null) {
        p = SolrParams.toSolrParams(args);
    }
    Map<String, ContentStreamLoader> registry = new HashMap<>();
    registry.put("application/xml", new XMLLoader().init(p));
    registry.put("application/json", new JsonLoader().init(p));
    registry.put("application/csv", new CSVLoader().init(p));
    registry.put("application/javabin", new JavabinLoader().init(p));
    registry.put("text/csv", registry.get("application/csv"));
    registry.put("text/xml", registry.get("application/xml"));
    registry.put("text/json", registry.get("application/json"));
    pathVsLoaders.put(JSON_PATH, registry.get("application/json"));
    pathVsLoaders.put(DOC_PATH, registry.get("application/json"));
    pathVsLoaders.put(CSV_PATH, registry.get("application/csv"));
    pathVsLoaders.put(BIN_PATH, registry.get("application/javabin"));
    return registry;
}
Also used : ContentStreamLoader(org.apache.solr.handler.loader.ContentStreamLoader) HashMap(java.util.HashMap) CSVLoader(org.apache.solr.handler.loader.CSVLoader) ModifiableSolrParams(org.apache.solr.common.params.ModifiableSolrParams) SolrParams(org.apache.solr.common.params.SolrParams) MapSolrParams(org.apache.solr.common.params.MapSolrParams) JsonLoader(org.apache.solr.handler.loader.JsonLoader) JavabinLoader(org.apache.solr.handler.loader.JavabinLoader) XMLLoader(org.apache.solr.handler.loader.XMLLoader)

Example 2 with JavabinLoader

use of org.apache.solr.handler.loader.JavabinLoader in project lucene-solr by apache.

the class MetricsCollectorHandler method init.

@Override
public void init(NamedList initArgs) {
    super.init(initArgs);
    if (initArgs != null) {
        params = SolrParams.toSolrParams(initArgs);
    } else {
        params = new ModifiableSolrParams();
    }
    loaders.put("application/xml", new XMLLoader().init(params));
    loaders.put("application/json", new JsonLoader().init(params));
    loaders.put("application/csv", new CSVLoader().init(params));
    loaders.put("application/javabin", new JavabinLoader().init(params));
    loaders.put("text/csv", loaders.get("application/csv"));
    loaders.put("text/xml", loaders.get("application/xml"));
    loaders.put("text/json", loaders.get("application/json"));
}
Also used : CSVLoader(org.apache.solr.handler.loader.CSVLoader) JsonLoader(org.apache.solr.handler.loader.JsonLoader) JavabinLoader(org.apache.solr.handler.loader.JavabinLoader) ModifiableSolrParams(org.apache.solr.common.params.ModifiableSolrParams) XMLLoader(org.apache.solr.handler.loader.XMLLoader)

Aggregations

ModifiableSolrParams (org.apache.solr.common.params.ModifiableSolrParams)2 CSVLoader (org.apache.solr.handler.loader.CSVLoader)2 JavabinLoader (org.apache.solr.handler.loader.JavabinLoader)2 JsonLoader (org.apache.solr.handler.loader.JsonLoader)2 XMLLoader (org.apache.solr.handler.loader.XMLLoader)2 HashMap (java.util.HashMap)1 MapSolrParams (org.apache.solr.common.params.MapSolrParams)1 SolrParams (org.apache.solr.common.params.SolrParams)1 ContentStreamLoader (org.apache.solr.handler.loader.ContentStreamLoader)1