Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » where silverstripe find data for search?

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 45299 Views
  • ojalà
    Avatar
    Community Member
    87 Posts

    where silverstripe find data for search? Link to this post

    Hi!
    I do my search form following the 4 tutorial.
    I have a question: where silverstripe do search?In it's inside database?So if I memorize some comments is possible to extract comments? sorry but the result of search is an empty page.

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: where silverstripe find data for search? Link to this post

    The search searches the 'SiteTree' table which stores the URLSegment, title of the page and the content on the page. If your page has custom fields on it the search currently cannot handle searching these. It will only search the default title, content fields

  • AndiAndi
    Avatar
    Community Member
    2 Posts

    Re: where silverstripe find data for search? Link to this post

    Will it be possible in the near future? It is important for me to be able to search custom fields, and I wonder if I should do a hack to make it work.

  • alx
    Avatar
    Community Member
    1 Post

    Re: where silverstripe find data for search? Link to this post

    Got the same issue here.
    The structure of Silverstripe is great. And the OO apsects brilliant.
    But not being able to search on specific custom fields is a total show stopper.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: where silverstripe find data for search? Link to this post

    You all raise good points.

    The SearchForm class is very restrictive, and only does the bare minimum of site search functionality. It does not support searching custom fields.

    The only way would be to hack the searchEngine() function on SearchForm to perform custom searching. The best way to achieve this is to subclass SearchForm and overload the searchEngine() function with your own search behaviour, using the existing searchEngine() as a guide.

    A more flexible SearchForm needs to be created in the future that allows for searching custom fields, better configuration, and better context searches while allowing for decent out of the box settings.

    Cheers,
    Sean

    45299 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.