PHPackages                             plasticstudio/search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. plasticstudio/search

ActiveSilverstripe-vendormodule[Search &amp; Filtering](/categories/search)

plasticstudio/search
====================

Search engine for Silverstripe websites - forked from jaedb/search

1.0.23(1y ago)22.6k↓50%3[1 PRs](https://github.com/PlasticStudio/Search/pulls)BSD-3-ClausePHP

Since Aug 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/PlasticStudio/Search)[ Packagist](https://packagist.org/packages/plasticstudio/search)[ Docs](https://psdigital.co.nz)[ RSS](/packages/plasticstudio-search/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (34)Used By (0)

The built-in SilverStripe search form is a very simple search engine. This plugin takes SQL-based searching to the next level, without requiring the implementation of a full-blown search engine like Solr or Elastic Search. It is designed to bring data-oriented filters on top of the simple text search functionality.

Requirements
============

[](#requirements)

- SilverStripe 4

Usage
=====

[](#usage)

- Create a `SearchPage` instance (typically at the root of your website). This page only is used to display results, so please refrain from creating multiple instances.
- Configure your website's `_config/config.yml` (or add `_config/search.yml`) to define search parameters.
- Run `dev/build` to instansiate your new configuration (this will also automatically create an instance of `SearchPage` if one does not exist).
- To overwrite the default `SearchPage` tmeplate, add a template file to your application: `templates/PlasticStudio/Search/Layout/SearchPage.ss`

Upgrading from jaedb/search
---------------------------

[](#upgrading-from-jaedbsearch)

Ensure you review the search config and update it to match the example config in this repo. Key changes:

1. `Table: 'SiteTree_Live'` -&gt; `Table: 'Page_Live'`
2. Add `JoinTables: ['SiteTree_Live']`

Elemental
=========

[](#elemental)

- Elemental search is included
- On page or Element save, all content from all Elements is saved to a field called `ElementalSearchContent` on sitetree.
- Simply include `'SiteTree_Live.ElementalSearchContent'` to the list of page columns
- Currently there is no way to exclude individual elements from being included.
- Run IndexPageContentForSearchTask to index element content

Configuration
=============

[](#configuration)

- `types`: associative list of types to search
    - `Label`: front-end field label
    - `Table`: the object's primary table (note `_Live` suffix for versioned objects)
    - `ClassName`: full ClassName
    - `ClassNameShort`: namespaced ClassName
    - `Filters`: a list of filters to apply pre-search (maps to `DataList->Filter(key => value)`)
    - `Columns`: columns to search for query string matches (format `Table.Column`)
- `filters`: associative list of filter options
    - `Structure`: defines the filter's relational structure (must be one of `db`, `has_one` or `many_many`)
    - `Label`: front-end field label
    - `Table`: relational subject's table
    - `Column`: column to filter on
    - `Operator`: SQL filter operator (ie `>`, `
