Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » Extending SearchForm.php for working with extended page classes

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

Page: 1
Go to End
Author Topic: 1257 Views
  • vancouverWill
    Avatar
    Community Member
    121 Posts

    Extending SearchForm.php for working with extended page classes Link to this post

    Has any had any success extending the built in search engine, i.e. searchForm.php? I have an extension of Page which has extra content areas which the user can update in the CMS. The search engine doesn't look for anything other than the standard variables in sitetree as can be seen in the file \sapphire\core\model\MySQLDatabase.php and the public function searchEngine.

    I tried editing it and haven't found a way to make it work without coming up with a harsh sql error.

    [User Error] Couldn't run query: SELECT count(*) FROM "SiteTree_Live" WHERE ("SiteTree_Live"."ClassName" IN ('TripleColumnPage','HomeRSSAggregatingPage','TestimonialsPage')) AND ( MATCH (ColumnOne,ColumnTwo,ColumnThree,BottomContent) AGAINST ('tewst*' IN BOOLEAN MODE) + MATCH (ColumnOne,ColumnTwo,ColumnThree,BottomContent) AGAINST ('tewst*' IN BOOLEAN MODE) ) Unknown column 'ColumnOne' in 'where clause'
    GET /searchpage/SearchForm?Search=tewst+&action_SynergyResults=Search

    Line 536 in /home/kathyw/public_html/synergy_silverstripe_blank_dev/sapphire/core/model/MySQLDatabase.php

    I can see that where sapphire is trying to create the SQL term it is having trouble joining the two database tables. Has anybody had any luck extending the search form in this way?

    I have used Symfony framework and with that there is an option to bring up the SQL query on screen to help with debugging. does anyone know of such a query with silverstripe.

  • vancouverWill
    Avatar
    Community Member
    121 Posts

    Re: Extending SearchForm.php for working with extended page classes Link to this post

    okay I have since found this post which is more sophisticated and established idea,

    http://www.silverstripe.org/all-other-modules/show/259512?start=24#post291101

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