Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7916

ExtractingDocumentLoader does not initialize context with Parser.class key and DelegatingParser needs that key.

    XMLWordPrintableJSON

    Details

      Description

      Tika PDFParser works perfectly with Solr except when you need to extract metadata from embedded images in PDF.

      When PDFParser finds an embedded image, it tries to execute a DelegatingParser over that image. But the problem is that DelegatingParser expects ParseContext to have Parser.class key.
      If that key is not present, it falls back to EmptyParser and inline image metadata is not extracted.

      I tried to extract metadata using standalone Tika and Tesseract OCR and it works fine (the text from PDF and from OCRed inline images is extracted)... but when i do the same from SolR, only the text from the PDF is extracted.

      I've properly configured PDFParser.properties with "extractInlineImages true"

      Also, I tried overriding the PDFParser with a custom one and adding the following line:

      context.set(Parser.class, new AutoDetectParser());
      

      And it worked... but I think that is not correct to modify the Tika PDFParser if it works ok when executing without SolR.

      Maybe the context should be initialized properly in the SolR class: ExtractingDocumentLoader.

      Sorry for my bad English, hope this information is useful, and please tell me if i'm doing wrong.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gcaseres Germán Cáseres
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: