Search in sources :

Example 1 with MCRSolrInputDocumentHandler

use of org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler in project mycore by MyCoRe-Org.

the class MCRSolrIndexHandlerFactory method getIndexHandler.

public MCRSolrIndexHandler getIndexHandler(Path file, BasicFileAttributes attrs, SolrClient solrClient, boolean sendContent) throws IOException {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Solr: submitting file \"{} for indexing", file);
    }
    MCRSolrIndexHandler indexHandler;
    long start = System.currentTimeMillis();
    if (sendContent) {
        /* extract metadata with tika */
        indexHandler = new MCRSolrFileIndexHandler(file, attrs, solrClient);
    } else {
        SolrInputDocument doc = MCRSolrPathDocumentFactory.getInstance().getDocument(file, attrs);
        indexHandler = new MCRSolrInputDocumentHandler(doc, solrClient);
    }
    long end = System.currentTimeMillis();
    indexHandler.getStatistic().addTime(end - start);
    return indexHandler;
}
Also used : SolrInputDocument(org.apache.solr.common.SolrInputDocument) MCRSolrFileIndexHandler(org.mycore.solr.index.handlers.stream.MCRSolrFileIndexHandler) MCRSolrIndexHandler(org.mycore.solr.index.MCRSolrIndexHandler) MCRSolrInputDocumentHandler(org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler)

Example 2 with MCRSolrInputDocumentHandler

use of org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler in project mycore by MyCoRe-Org.

the class MCRSolrMCRContentIndexHandler method getSubHandlers.

@Override
public List<MCRSolrIndexHandler> getSubHandlers() {
    MCRSolrIndexHandler mcrSolrIndexHandler = new MCRSolrInputDocumentHandler(document, getSolrClient());
    mcrSolrIndexHandler.setCommitWithin(getCommitWithin());
    return Collections.singletonList(mcrSolrIndexHandler);
}
Also used : MCRSolrIndexHandler(org.mycore.solr.index.MCRSolrIndexHandler) MCRSolrInputDocumentHandler(org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler)

Example 3 with MCRSolrInputDocumentHandler

use of org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler in project mycore by MyCoRe-Org.

the class MCRSolrMCRContentMapIndexHandler method splitup.

private void splitup(Iterator<SolrInputDocument> documents) {
    while (documents.hasNext()) {
        MCRSolrInputDocumentHandler subhandler = new MCRSolrInputDocumentHandler(documents.next());
        subhandler.setCommitWithin(getCommitWithin());
        subhandlers.add(subhandler);
    }
    contentMap.clear();
}
Also used : MCRSolrInputDocumentHandler(org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler)

Aggregations

MCRSolrInputDocumentHandler (org.mycore.solr.index.handlers.document.MCRSolrInputDocumentHandler)3 MCRSolrIndexHandler (org.mycore.solr.index.MCRSolrIndexHandler)2 SolrInputDocument (org.apache.solr.common.SolrInputDocument)1 MCRSolrFileIndexHandler (org.mycore.solr.index.handlers.stream.MCRSolrFileIndexHandler)1