Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Can Silverstripe search file


Reply


3 Posts   1283 Views

Avatar
eceers

Community Member, 24 Posts

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 [url]http://doc.silverstripe.org/modules:sphinx[/url] but can't seem to find much more on it.

Any help would be greatly appreciated.

Avatar
Willr

Forum Moderator, 5513 Posts

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.

Avatar
swaiba

Forum Moderator, 1804 Posts

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';

   $data['Results']->push($p);
}