I'm using Lucene to implement a document search engine.
Right now, whenever a new document is uploaded, I use Tika to extract all the contents of the document and store it in plain text. The rich text document and the .txt are linked in a database, so text extraction only needs to be done once.
When it comes to show results to the user, there are 2 main features:
- Download original file
- Download highlighted PDF with search results.
About the second part, I'm not sure how to do it. I know the actually proper way is to implement a PDF reader browser plugin, install it on client's browser and use it to highlight on the fly using client's CPU, however, unless you tell me there's an open source (or affordable, something cheaper than one thousand euro) software that does so, this is unfeasible for this project: the viewer itself needs much more coding than the rest of the application to take into consideration: multiple browsers, multiple pdf specification formats, etc.
The second way that occurs to me is to use some software to insert the marks to highlight inside the octect-stream on the fly, at the same time the system reads it to send it to the user. Seems like a lot of errors could happen.
And the worst way, whenever a user requests to download a file, to have a bash utilitty that:
- Highlights the findingd and save it to a new temporal file
- Serve the remporal fle to the user
- Delete the temporal file.
I also need to highlight some docx too. Originally I made the highlight using Lucene and plain text, however, the user says it is too ugly, so as the end, he agreed to have ONLY pdf's highlighted (if a docx has to be highlighted, it needs to be converted to pdf (probably at upload time), yeah, I know, hilarious, but that's what the client wants).
The problem is that we dont have time to spare on this feature.
Any software recommendations for this? Highlighter must be able to run on linux via shell.
Findings so far:
- PDF Highlighter - Too expensive. 4.000 $ for a perpetual license or 1200 $ per year. I believe it is absolutely overkill to perform a task in the wrong way: its just adding a couple of tags around search results. Seems that has every feature we need.
- Very PDF - Website seems to be templated. Looks like they took more effort in billing people than anything else. Normally, this kind of websites just sell software that are mere paying GUIs to open source tools, so I dont really trust this. Besides, I cannot find Linux support anywhere. I really dont want to use Wine for this.