Examples of IndexDocument


Examples of org.wso2.carbon.registry.indexing.solr.IndexDocument

    try {
      POIFSFileSystem fs = new POIFSFileSystem(new ByteArrayInputStream(fileData.data));
      PowerPointExtractor extractor = new PowerPointExtractor(fs);
      String ppText = extractor.getText();

      return new IndexDocument(fileData.path, ppText, null);
    } catch (IOException e) {
      String msg = "Failed to write to the index";
      log.error(msg, e);
      throw new SolrException(ErrorCode.SERVER_ERROR, msg);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.indexing.solr.IndexDocument

import org.wso2.carbon.registry.indexing.solr.IndexDocument;

public class PlainTextIndexer implements Indexer {

  public IndexDocument getIndexedDocument(File2Index fileData) throws SolrException {
    return new IndexDocument(fileData.path, new String(fileData.data), null);
  }
View Full Code Here

Examples of org.wso2.carbon.registry.indexing.solr.IndexDocument

      };
      SAXParserFactory factory = SAXParserFactory.newInstance();
      SAXParser saxParser = factory.newSAXParser();
      saxParser.parse(inData, handler);

      return new IndexDocument(fileData.path, xmlAsStr,
                         contentOnly.toString());
    } catch (MalformedURLException e) {
      throw new SolrException(ErrorCode.SERVER_ERROR, "Error at indexing", e);
    } catch (IOException e) {
      throw new SolrException(ErrorCode.SERVER_ERROR, "Error at indexing", e);
View Full Code Here

Examples of org.wso2.carbon.registry.indexing.solr.IndexDocument

    try {
      POIFSFileSystem fs = new POIFSFileSystem(new ByteArrayInputStream(fileData.data));
      WordExtractor extractor = new WordExtractor(fs);
      String wordText = extractor.getText();

      return new IndexDocument(fileData.path, wordText, null);
    } catch (IOException e) {
      String msg = "Failed to write to the index";
      log.error(msg, e);
      throw new SolrException(ErrorCode.SERVER_ERROR, msg);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.indexing.solr.IndexDocument

    try {
      POIFSFileSystem fs = new POIFSFileSystem(new ByteArrayInputStream(fileData.data));
      ExcelExtractor extractor = new ExcelExtractor(fs);
      String excelText = extractor.getText();

      return new IndexDocument(fileData.path, excelText, null);
    } catch (IOException e) {
      String msg = "Failed to write to the index";
      log.error(msg, e);
      throw new SolrException(ErrorCode.SERVER_ERROR, msg);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.indexing.solr.IndexDocument

      PDFTextStripper stripper = new PDFTextStripper();
      String docText = stripper.getText(new PDDocument(cosDoc));
      cosDoc.close();

      return new IndexDocument(fileData.path, docText, null);
    } catch (IOException e) {
      String msg = "Failed to write to the index";
      log.error(msg, e);
      throw new SolrException(ErrorCode.SERVER_ERROR, msg);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.