Jump to:

23361 Posts in 18124 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Make a custom PageType searchable?

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: 971 Views
  • bezarre
    Avatar
    Community Member
    13 Posts

    Make a custom PageType searchable? Link to this post

    Hello,

    I have the following problem:

    First of all: I enabled the fulltextsearch feature.
    Now I have many different Pagetypes like:

    class PartnerHolder extends Page
    {
       static $singular_name = 'Partner';
       static $plural_name = 'Partner';
       
       static $has_many = array (
          'Partner' => 'Partner'
       );
       
    }

    Partner.php

    class Partner extends Member
    {
       static $singular_name = 'Partner';
       static $plural_name = 'Partner';
       static $db = array (
          'Detail' => 'Text',
          'Detail2' => 'Text'

       );
    //....
    }

    Now I want that the search includes the two fields (Detail, Detail2). Is there a way to do this?

    Micha

  • Willr
    Avatar
    Forum Moderator
    5483 Posts

    Re: Make a custom PageType searchable? Link to this post

    Well more specifically you want to make Detail and Detail2 on the dataobject searchable rather than the page since that'll already be indexed. My recommended way of adding functionality like this to SilverStripe is to use the sphinx search module. http://silverstripe.org/sphinx-module/ has a lot more features and is much more configurable than the default search engine.

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