Searching content into a pdf file

Author Message

Simone Conti

Monday 01 August 2011 7:34:00 am

Hi there, 

I have a lot of pdf files in my site and I need to enable EzPublish look for a specific content into those pdf files, in order to list the results together with the standard search results.

Is that possible? Is there any extension or something else to enable to make it possible?

Thank you so much!

Peter Keung

Monday 01 August 2011 7:51:40 am

This is the first thing that comes to mind: http://projects.ez.no/eztika

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Simone Conti

Monday 01 August 2011 8:05:24 am

Unfortunately is not what I'm looking for.

I need something that allows me to search into a pdf files. Somebody told me that EzPublish has this feature embedded but it needs to be allowed.

Any suggestions?

Steven E. Bailey

Monday 01 August 2011 9:07:18 am

eZPublish does have this feature and you should be seeing your pdfs indexed - with a bunch of caveats.

What happens is that when a pdf is saved (or you update your search index), the pdf is run through the tool defined by 

[PDFHandlerSettings]
TextExtractionTool=pstotext

in your binaryfile.ini

If you don't have this tool on your machine, then your pdfs won't be indexed. 

If you search for TextExtractionTool or pdftotext in these forums you'll see a couple other possible tools - such as:

http://share.ez.no/forums/extensions/ez-find/solr-indexing-error

If you have whatever tool you are using and if you're pdfs aren't being indexed, then it probably means that your pdfs aren't structurally text - the content is actually an image (or series of images) saved in the pdf container.  It means that you're not going to be able to index using pdftotext - a good test is to run whatever tool you have on the command line against the file that isn't be indexed to see what actually comes out.  If nothing comes out you'll have to use some other tool - like eztika (I've never used it) or, something like tesseract to extract the text.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Simone Conti

Thursday 04 August 2011 3:26:58 am

Now something works.

I decided to use eztika as suggested by Peter.

I have a question: where does eztika store its data? I hope it's not made to scan all pdf for each search... I have a very large number of pdf files!!

 

Thanks

Paul Borgermans

Friday 05 August 2011 10:23:26 am

Hi

eztika does not store the data itself, its goal is to extract the plain text for subsequent indexing by the configured search plugin (you should use eZ Find of course :) )

the default search plugin stores the indexing result in the database, while eZ Find uses Solr which stores its data into Lucene index files on teh filesystem

This is done only when the pdf is uploaded or updated.

hth

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:14:53
Script start
Timing: Jan 18 2025 02:14:53
Module start 'layout'
Timing: Jan 18 2025 02:14:53
Module start 'content'
Timing: Jan 18 2025 02:14:54
Module end 'content'
Timing: Jan 18 2025 02:14:54
Script end

Main resources:

Total runtime0.7818 sec
Peak memory usage4,096.0000 KB
Database Queries72

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 591.1016152.6250
Module start 'layout' 0.00520.0030 743.726639.4688
Module start 'content' 0.00820.7718 783.1953660.5313
Module end 'content' 0.78000.0018 1,443.726616.1563
Script end 0.7818  1,459.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4252160.0002
Check MTime0.00130.1708160.0001
Mysql Total
Database connection0.00070.093310.0007
Mysqli_queries0.719692.0365720.0100
Looping result0.00080.1036700.0000
Template Total0.750696.020.3753
Template load0.00190.245420.0010
Template processing0.748695.752820.3743
Template load and register function0.00010.016710.0001
states
state_id_array0.00080.099810.0008
state_identifier_array0.00100.126520.0005
Override
Cache load0.00170.2111410.0000
Sytem overhead
Fetch class attribute can translate value0.00060.073140.0001
Fetch class attribute name0.00150.185690.0002
XML
Image XML parsing0.00180.224240.0004
class_abstraction
Instantiating content class attribute0.00000.002190.0000
General
dbfile0.00270.3414310.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs