Skip to content

Commit

Permalink
defaultSearchTermOptions tweaks
Browse files Browse the repository at this point in the history
resolves #2737
  • Loading branch information
brandonkelly committed Apr 13, 2018
1 parent e41abcb commit 29dd587
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Changed
- New sites’ Base URLs now default to `@web/`.
- Textual custom fields now ensure that they don’t contain 4+ byte characters. ([#2725](https://github.com/craftcms/cms/issues/2725))
- It is no longer expected that all of the `defaultSearchTermOptions` config setting options will be set if any of the default option values need to be overridden. ([#2737](https://github.com/craftcms/cms/issues/2737))

### Fixed
- Fixed a bug where the Clear Caches utility was not deleting template caches. ([#2720](https://github.com/craftcms/cms/issues/2720))
Expand Down
20 changes: 7 additions & 13 deletions src/config/GeneralConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,13 @@ class GeneralConfig extends BaseObject
/**
* @var array The default options that should be applied to each search term.
* Options include:
* - `attribute` – The attribute that the term should apply to (e.g. 'title'), if any
* - `exact` – Whether the term must be an exact match (only applies if `attribute` is set)
* - `exclude` – Whether search results should *exclude* records with this term
* - `subLeft` – Whether to include keywords that contain the term, with additional characters before it
* - `subRight` – Whether to include keywords that contain the term, with additional characters after it
*/
public $defaultSearchTermOptions = [
'attribute' => null,
'exact' => false,
'exclude' => false,
'subLeft' => false,
'subRight' => true,
];
* - `attribute` – The attribute that the term should apply to (e.g. 'title'), if any. (`null` by default)
* - `exact` – Whether the term must be an exact match (only applies if `attribute` is set). (`false` by default)
* - `exclude` – Whether search results should *exclude* records with this term. (`false` by default)
* - `subLeft` – Whether to include keywords that contain the term, with additional characters before it. (`false` by default)
* - `subRight` – Whether to include keywords that contain the term, with additional characters after it. (`true` by default)
*/
public $defaultSearchTermOptions = [];
/**
* @var string[] The template file extensions Craft will look for when matching a template path to a file on the front end.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/search/SearchQueryTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SearchQueryTerm extends BaseObject
/**
* @var bool
*/
public $subRight = false;
public $subRight = true;

/**
* @var null
Expand Down

0 comments on commit 29dd587

Please sign in to comment.