21491 Posts in 5783 Topics by 2621 members
|Go to End|
6 May 2010 at 6:42pm
My client has a need to be able to include text from PDF's in site searchs. Does anyone know if this possible using the standard silverstripe search?
I found this page http://doc.silverstripe.org/modules:sphinx but can't seem to find much more on it.
Any help would be greatly appreciated.
6 May 2010 at 10:32pm
The built in search cannot search pdf text so you'll have to use Sphinx which you can download via svn - http://svn.silverstripe.com/open/modules/sphinx/trunk. A bit more documentation is available in the readme file / docs bundled with the module.
7 May 2010 at 9:00pm
no, but you do not need any exe's to do so, you can use php functions to get the text content of a pdf (http://www.webcheatsheet.com/php/reading_clean_text_from_pdf.php) and then you can change "function results($data, $form)" in Page.php to add items to the results based on what you find.
foreach ($arrPDFs as $pdf)
$p = new Page();
$p->Title = "Title"; //update with value from current pdf
$p->URLSegment = "URLSegment"; //update with value from current pdf
$p->Content = "Content"; //update with value from current pdf
$p->Name = "Name"; //update with value from current pdf
$p->Relevance = 1;//not sure about this one
$p->CanViewType = 'Anyone';
|Go to Top|