Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to configure Extracting Text custom process in nifi

Solved Go to solution
Highlighted

How to configure Extracting Text custom process in nifi

Rising Star

Hi,

I've followed the following document and added ExtractText processor supported by TIKA.

ExtractText NiFi Custom Processor Powered by Apache Tika

Could you please help me what properties i need to add for the configuration? I used Getfile to ingest the pdf file, but i am not sure how this custom process should be configured. Any help would be appreciated.

SJ

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to configure Extracting Text custom process in nifi

Guru

Hi @Sanaz Janbakhsh

I just did a quick test using GetFile to ingest a PDF, and used the custom processor as is without any configuration. I then used a PutFile to drop the output of the Extracted text to a dir. As expected, the output is the text lifted from the original PDF, in a text file format. No special configuration required. If you are looking to play with the metadata using Tika, you can look at the ExtractMediaMetadata processor which comes with modern versions of NiFi out of the box and uses Tika under the hood.

38478-screen-shot-2017-08-31-at-110825-am.png

5 REPLIES 5

Re: How to configure Extracting Text custom process in nifi

Guru

Hi @Sanaz Janbakhsh

I just did a quick test using GetFile to ingest a PDF, and used the custom processor as is without any configuration. I then used a PutFile to drop the output of the Extracted text to a dir. As expected, the output is the text lifted from the original PDF, in a text file format. No special configuration required. If you are looking to play with the metadata using Tika, you can look at the ExtractMediaMetadata processor which comes with modern versions of NiFi out of the box and uses Tika under the hood.

38478-screen-shot-2017-08-31-at-110825-am.png

Re: How to configure Extracting Text custom process in nifi

Rising Star

Hi Sonu,

Thanks for the advice. Just a question, what if i want to extract specific text from pdf and not extract the whole pdf to text.Is it possible?

Thanks

Re: How to configure Extracting Text custom process in nifi

Guru

Hi @Sanaz Janbakhsh

You could probably achieve that by combining processors. Use the Tika-based processor to extract everything from the pdf in txt form, and then use another processor (ExtractText with RegEx to find your content for example) to extract the specific text you want, and decide what to do with that content from there.

Re: How to configure Extracting Text custom process in nifi

Rising Star

Thanks Sonu

Re: How to configure Extracting Text custom process in nifi

Super Guru

My custom processor is pretty easy to customize.

https://github.com/tspannhw/nifi-extracttext-processor

You can tweak it to extract just somethings, Apache Tika is very powerful.

Don't have an account?
Coming from Hortonworks? Activate your account here