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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Custom Fields added to Site Search


Go to End


7 Posts   3245 Views

Avatar
Terry Apodaca

Community Member, 112 Posts

10 March 2011 at 7:51am

I have the Ecommerce Module installed and working great. Client loves it!

One thing I need to figure out how to do is add custom fields the Site Search. On the Product page (CMS) I have given the client a few new fields that don't come standard with the default module. The issue is they want those to be searchable on the front end and from what I can tell the Site Search will only search the Title fields and the Content fields...not the others

Is there something I can do to get the Custom Fields added to the Site Search?

Avatar
inCharge

Community Member, 102 Posts

11 March 2011 at 9:43am

I asked the same question a while back...

http://silverstripe.org/customising-the-cms/show/14574

...but I still haven't got around to implementing Sphinx.

Avatar
Terry Apodaca

Community Member, 112 Posts

15 March 2011 at 10:51am

Yeah, I can't do the Sphinx module.

There has to be an easier way to add custom fields to the front facing search. They allow it in the CMS, and now it's easy to add regular DataObjects, but since this module is on the SiteTree and uses specific searches I can't get it to work.

Avatar
SamTheJarvis

Community Member, 24 Posts

22 June 2011 at 10:42pm

Have a look at SearchContext, not sure how it relates to the default Site Search.

http://doc.silverstripe.org/sapphire/en/reference/searchcontext
&
http://api.silverstripe.org/2.4/sapphire/search/SearchContext.html

With this I have managed to search all dataobjects of a certain class, through multiple fields and return a DOset of qualifying DOs, with pagination.

Don't have the code for it at the moment, but SearchContext is probably what you want to be looking at, was easy enough to edit the given example.

Avatar
Nicolaas

Forum Moderator, 224 Posts

6 November 2011 at 11:58pm

Hey Terry

If you are still looking for an answer to your question then I might be able to help.

Nicolaas

Avatar
Terry Apodaca

Community Member, 112 Posts

8 November 2011 at 5:43am

Nicolaas,

I figured out a workaround, probably not the best, but something that worked and was really invisible to the Client. I'd really like to know what you have for a solution though...for future projects.

Avatar
WebGem

Community Member, 2 Posts

24 November 2011 at 9:33pm

This has been an issue for me on several sites. I have not been able to find a reasonable fix for searching custom fields. Any input would be greatly appreciated.