Jump to:

23358 Posts in 18005 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Site Search including Dataobjects

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: 349 Views
  • cumquat
    Avatar
    Community Member
    190 Posts

    Site Search including Dataobjects Link to this post

    Hi there,

    Been trying to find the best way to integrate some dataobject fields in the Fulltext site search. I'm using 3.1 rc1 and the site is hosted on a shared hosting site so no access to install services (like solr) adding modules is fine.

    Looking at the documentation for 3.1 regarding search it seems to intimate that by adding

    private static $create_table_options = array(
    'MySQLDatabase' => 'ENGINE=MyISAM'
    );


    to a data object that it will be included in the fulltext site search. (granted i may be reading/understanding it wrong)

    info is here http://doc.silverstripe.org/framework/en/3.1/topics/search

    Regards

    Mick

  • cumquat
    Avatar
    Community Member
    190 Posts

    Re: Site Search including Dataobjects Link to this post

    Bump?

    Anyone my lack of experience is starting to show again trying to deal with searching on the site, i'd like to not have multiple search boxes. Any help?

    Mick

  • cumquat
    Avatar
    Community Member
    190 Posts

    Re: Site Search including Dataobjects Link to this post

    bump bump..

  • Mo
    Avatar
    Community Member
    504 Posts

    Re: Site Search including Dataobjects Link to this post

    I have done this in the past by overwriting the default search method on your controller to search for both page objects and other dataobjects.

    I then merged the results sets into one DataObjectSet (this was in SS 2.1) and then returned that to the results page.

    It is important though that your returned objects have properties that mirror a page object (title, content, link,etc). Otherwise it can cause issues in the search results (and merging the object sets).

    I did write a tutorial for 2.1 here: http://www.i-lateral.com/tutorials/extending-fulltextsearch-for-dataobjects/

    I don't think you would need to do a load of work to get it running on 3.

    Cheers,

    Mo

  • cumquat
    Avatar
    Community Member
    190 Posts

    Re: Site Search including Dataobjects Link to this post

    Thanks for your help Mo, much appreciated.
    I still never really managed to get it working confidently but it looks like i'm not getting the job i needed it for now so im giving this a rest till i get some spare time to try and work it out again.

    Cheers

    Mick

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