Download the PHP package plasticstudio/search without Composer
On this page you can find all versions of the php package plasticstudio/search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plasticstudio/search
More information about plasticstudio/search
Files in plasticstudio/search
Package search
Short Description Search engine for Silverstripe websites - forked from jaedb/search
License BSD-3-Clause
Homepage https://psdigital.co.nz
Informations about the package search
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
- Silverstripe 6
- For Silverstripe 4/5 see 1.x
Usage
- Create a
SearchPageinstance (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/buildto instansiate your new configuration (this will also automatically create an instance ofSearchPageif one does not exist). - To overwrite the default
SearchPagetmeplate, add a template file to your application:templates/PlasticStudio/Search/Layout/SearchPage.ss
Upgrading from SS5 to SS6
Rename $SearchForm to $BasicSearchForm in page templates
Upgrading from jaedb/search
Ensure you review the search config and update it to match the example config in this repo. Key changes:
Table: 'SiteTree_Live'->Table: 'Page_Live'- Add
JoinTables: ['SiteTree_Live']
Elemental
- Elemental search is included
- On page or Element save, all content from all Elements is saved to a field called
ElementalSearchContenton 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
types: associative list of types to searchLabel: front-end field labelTable: the object's primary table (note_Livesuffix for versioned objects)ClassName: full ClassNameClassNameShort: namespaced ClassNameFilters: a list of filters to apply pre-search (maps toDataList->Filter(key => value))Columns: columns to search for query string matches (formatTable.Column)
filters: associative list of filter optionsStructure: defines the filter's relational structure (must be one ofdb,has_oneormany_many)Label: front-end field labelTable: relational subject's tableColumn: column to filter onOperator: SQL filter operator (ie>,<,=)JoinTables: associative list of relationship mappings (use thekeyfrom thetypesarray)Table: relational join tableColumn: column to join bysorts: associative list of sort options. These are used to popoulate a "Sort by" dropdown field in the Advanced Search Form. Sort order of search results will default to the top item in this list.Label: front-end field labelSort: SQL sort string
search_form_placeholder_text: Change search input field placeholder text (defaults to "Keywords")submit_button_text: Text to use on search form submit button (defaults to "Search")
TODO: defaults: Default attributes or settings, as opposed to those submitted through the search form.
Indexing Dataobjects
The search checks canView permissions for Dataobjects before indexing, so you likely need to add:
Example configuration
All versions of search with dependencies
silverstripe/framework Version ^6
silverstripe/vendor-plugin Version ^3