List of usage examples for org.apache.solr.handler.extraction SolrContentHandler SolrContentHandler
public SolrContentHandler(Metadata metadata, SolrParams params, IndexSchema schema)
From source file:com.ngdata.hbaseindexer.parse.tika.TikaSolrDocumentExtractor.java
License:Apache License
private SolrInputDocument extractInternal(byte[] input) { Metadata metadata = new Metadata(); metadata.add(LiteralMimeDetector.MIME_TYPE, mimeType); Map<String, String> cellParams = (params == null || params.isEmpty()) ? DEFAULT_CELL_PARAMS : params; SolrContentHandler handler = new SolrContentHandler(metadata, new MapSolrParams(cellParams), indexSchema); try {/*from w w w. j a va2 s .c o m*/ parser.parse(new ByteArrayInputStream(input), handler, metadata, new ParseContext()); } catch (Exception e) { throw new RuntimeException(e); } return handler.newDocument(); }