Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

help needed with search


Reply


2 Posts   869 Views

Avatar
Webdoc

Community Member, 333 Posts

18 September 2010 at 6:46am

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

Avatar
Webdoc

Community Member, 333 Posts

18 September 2010 at 7:00am

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',
)
);