Class TikaIndexerUtil


  • public final class TikaIndexerUtil
    extends Object
    Util class for use of tika methods.
    • Method Detail

      • parseHtml

        public static ContentHandler parseHtml​(String strContentToIndex,
                                               org.apache.tika.metadata.Metadata metadata,
                                               org.apache.tika.parser.ParseContext parseContext)
                                        throws LuteceSolrException
        Parse the xml content
        Parameters:
        strContentToIndex -
        metadata -
        parseContext -
        Returns:
        the content handler containing the parsed content
        Throws:
        LuteceSolrException
      • parse

        public static ContentHandler parse​(InputStream stream,
                                           org.apache.tika.metadata.Metadata metadata,
                                           org.apache.tika.parser.ParseContext parseContext)
                                    throws LuteceSolrException
        Identify the type of content and parse the stream
        Parameters:
        stream -
        Returns:
        the content handler containing the parsed content
        Throws:
        LuteceSolrException
      • addFileContentToSolrItem

        public static void addFileContentToSolrItem​(SolrItem item,
                                                    byte[] fileContent)
                                             throws LuteceSolrException
        Parse and add the content of a file to the solr item.
        Parameters:
        item -
        fileContent - the content of the file
        Throws:
        LuteceSolrException
      • addFileContentToSolrItem

        public static void addFileContentToSolrItem​(SolrItem item,
                                                    List<byte[]> fileContentList)
                                             throws LuteceSolrException
        Parse and add the content of multiples files to the solr item.
        Parameters:
        item -
        fileContentList - the content of the files
        Throws:
        LuteceSolrException