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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

help needed with search


Go to End


2 Posts   1069 Views

Avatar
Webdoc

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