Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Can Silverstripe search file

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

Page: 1
Go to End
Author Topic: 1221 Views
  • eceers
    Avatar
    Community Member
    24 Posts

    Can Silverstripe search file Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Can Silverstripe search file Link to this post

    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.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Can Silverstripe search file Link to this post

    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);
    }

    1221 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.