Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » help needed with search

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: 811 Views
  • Webdoc
    Avatar
    Community Member
    332 Posts

    help needed with search Link to this post

    How to set the costumcontextsearch field names translateable

    static $searchable_fields = array(
          'Elamutyyp' => 'ExactMatchFilter',
          'Hind' => 'ExactMatchFilter',
          'Tubadearv' => 'ExactMatchFilter',
          'Yldpind' => 'ExactMatchFilter',
          'Linn' => 'ExactMatchFilter',
          );

       static $summary_fields = array(
          'Elamutyyp',
          'Hind',
          'Tubadearv',
          'Yldpind',
          'Linn'
          );

    function getCustomSearchContext() {
          $fields = $this->scaffoldSearchFields(array (
             'restrictFields' => array (
             'Elamutyyp' => 'Elamutyyp',
             'Hind' => 'Hind',
             'Tubadearv'=>'Tubadearv',
             'Yldpind'=>'Yldpind',
             'Linn'=>'Linn'
    )
    ));
    $filters = array (
    'Elamutyyp' => new ExactMatchFilter('Elamutyyp'),
    'Hind' => new ExactMatchFilter('Hind'),
    'Tubadearv' => new ExactMatchFilter('Tubadearv'),
    'Yldpind' => new ExactMatchFilter('Yldpind'),
    'Linn' => new ExactMatchFilter('Linn')
    );
    return new SearchContext($this->class, $fields, $filters); }

  • Webdoc
    Avatar
    Community Member
    332 Posts

    Re: help needed with search Link to this post

    static $searchable_fields = array(
    'Elamutyyp' => array(
    'title' => 'the translation rendering code',
    'filter' => 'ExactMatchFilter',
    ),
    'Hind' => array(
    'title' => 'the translation ',
    'filter' => 'ExactMatchFilter',
    ),
    'Tubadearv' => array(
    'title' => 'the translation ',
    'filter' => 'ExactMatchFilter',
    ),
    'Yldpind' => array(
    'title' => 'the translation ',
    'filter' => 'ExactMatchFilter',
    ),
    'Linn' =>array(
    'title' => 'the translation ',
    'filter' => 'ExactMatchFilter',
    )
    );

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