iqnection-pages/searchresultspage

SilverStripe Search Page

Installs: 88

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 6

Forks: 1

Open Issues: 1

Type:silverstripe-vendormodule

pkg:composer/iqnection-pages/searchresultspage

2.1.3 2021-02-05 20:26 UTC

This package is auto-updated.

Last update: 2025-10-07 17:40:45 UTC


README

Searches all pages and data objects (that have a proper index)

All DataObject subclasses that include a fulltext index named "SearchFields" will be searched Specify the database columns you want to be searched as follows:

private static $indexes = [
	'SearchFields' => [
		'type' => 'fulltext',
		'columns' => ['MyField1', 'MyField2'],
	]
];

You'll also need to set the tabel engine as follows

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

Build your search form setting the search input with the name "s", and post to the search page action "results"

<form method="get" action="{$SearchPage.Link(results)}">
    <input type="search" name="s" value="" />
    <input type="submit" value="Search" />
</form>

see: https://docs.silverstripe.org/en/4/developer_guides/search/fulltextsearch/ for more information on full text search