I have 'Productcode' => 'Text' as a text field in my cms and template it works well just i need to be searchable
have this in Swipestripe code:
private static $searchable_fields = array(
'Title' => array(
'field' => 'TextField',
'filter' => 'PartialMatchFilter',
'title' => 'Name'
do i need to add some extracode to swipestripe product.php to make the product code searchable
Don't alter core code (ie, swipestripe core).
Make an extension like muskie9 has suggested and use that to add both the definition and the extra method :)
I'd be midly surprised if there's not already some kind of search function in swipestripe for seraching products though...
$searchable_fields is just for backend filtering. Added fields aren't included in the default site search. You'll have to provide your own search service. Check the Silverstripe tutorials, it's an easy job. Alternatively it is possible to extend the search service to include the extra field. It's all in the docs.
$searchable_fields is for whatever kind of filtering you want, provided your custom search makes use of it.
By default it's not a part of SearchForm via FulltextSearchable, no. But then not much is, and it's not very extensible at all.
However IIRC SearchContext does make use of it, if one were inclined to use that.