@Test
    public void oneOff() throws Exception {
        String core = "tika-example";
        String url = "http://localhost:8983/solr";
        String emitKey = "one-off-test-doc";
        SolrEmitter solrEmitter = new SolrEmitter();
        solrEmitter.setSolrUrls(Collections.singletonList(url));
        solrEmitter.setSolrCollection(core);
        solrEmitter.initialize(Collections.EMPTY_MAP);

        Metadata metadata = new Metadata();
        metadata.set(TikaCoreProperties.CREATED, new Date());
        metadata.set(TikaCoreProperties.TIKA_CONTENT, "the quick brown fox");

        Map<String, String> mappings = new HashMap();
        FieldNameMappingFilter filter = new FieldNameMappingFilter();
        mappings.put(TikaCoreProperties.CREATED.getName(), "created");
        mappings.put(TikaCoreProperties.TIKA_CONTENT.getName(), "content");
        filter.setMappings(mappings);
        filter.filter(metadata);

        solrEmitter.emit(emitKey, Collections.singletonList(metadata), new ParseContext());
    }
This is meant only for one off development tests with a locally
running instance of Solr.  Please add unit tests to the
tika-integration-tests/tika-pipes-solr-integration-tests
tika-pipes/tika-emitters/tika-emitter-solr/src/test/java/org/apache/tika/pipes/emitter/solr/SolrEmitterDevTest.java