2

Upgrading site from 3 to 4. Existing code makes use of FullTextSearchable as per this guide that exists for 3, but not for 4. Google only results in unanswered questions of the same nature. Except for this one, which doesn't help. But I do find this guide for SS4, which is not geared towards the same topic really, but somewhat helpful.

Here is my code:

_config.php

\SilverStripe\ORM\Search\FulltextSearchable::enable();

Page.php

use SilverStripe\ORM\Connect\MySQLSchemaManager;

private static $create_table_options = [
    MySQLSchemaManager::ID => 'ENGINE=MyISAM'
];

Page.ss

$SearchForm

Expected: Standard search form is displayed

Actual: Nothing is displayed

I went as far as to hard code the form from the existing site onto the template to see if the search function itself works:

Page.ss

<form id="SearchForm_SearchForm" action="/home/SearchForm" method="get" enctype="application/x-www-form-urlencoded">
    <p id="SearchForm_SearchForm_error" class="message " style="display: none"></p>
    <fieldset>
        <input type="text" name="Search" value="Search" class="text nolabel" id="SearchForm_SearchForm_Search">
        <div class="form-group">
            <input type="submit" name="action_results" value="Go" class="action" id="SearchForm_SearchForm_action_results">
        </div>
    </fieldset>
</form>

Expected: Search results page displays with relevant search results for the entered term

Actual: 404 page not found

Aaryn
  • 1,601
  • 2
  • 18
  • 31

0 Answers0