Skip to content

Commit

Permalink
SS4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed Dec 4, 2017
1 parent fe7215c commit b6d587f
Show file tree
Hide file tree
Showing 30 changed files with 1,171 additions and 1,128 deletions.
13 changes: 13 additions & 0 deletions .upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mappings:
ExtensibleSearchAPI: 'nglasl\extensible\ExtensibleSearchAPI'
ExtensibleSearchPageController: 'nglasl\extensible\ExtensibleSearchPageController'
ExtensibleSearchExtension: 'nglasl\extensible\ExtensibleSearchExtension'
ExtensibleSearch: 'nglasl\extensible\ExtensibleSearch'
ExtensibleSearchArchive: 'nglasl\extensible\ExtensibleSearchArchive'
ExtensibleSearchArchived: 'nglasl\extensible\ExtensibleSearchArchived'
ExtensibleSearchSuggestion: 'nglasl\extensible\ExtensibleSearchSuggestion'
ExtensibleSearchPage: 'nglasl\extensible\ExtensibleSearchPage'
CustomSearchEngine: 'nglasl\extensible\CustomSearchEngine'
ExtensibleSearchService: 'nglasl\extensible\ExtensibleSearchService'
ExtensibleSearchArchiveTask: 'nglasl\extensible\ExtensibleSearchArchiveTask'
UnitTests: 'nglasl\extensible\tests\UnitTests'
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_The current release is **4.0.0**_

> A module for SilverStripe which will allow user customisation and developer extension of a search page instance, including analytics and suggestions.
> This module allows user customisation and developer extension of a search page instance, including analytics and suggestions.
## Requirement

Expand All @@ -21,7 +21,7 @@ _The current release is **4.0.0**_

This is automatically created, and allows configuration for search based on a search engine (more below).

![page](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/images/extensible-search-page.png)
![page](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/client/images/extensible-search-page.png)

### Search Engine

Expand All @@ -30,14 +30,14 @@ The extensible search page is designed to use full-text search out of the box, w
#### Full-Text

```yaml
FulltextSearchable:
SilverStripe\ORM\Search\FulltextSearchable:
searchable_classes:
- 'SiteTree'
SiteTree:
- 'SilverStripe\CMS\Model\SiteTree'
SilverStripe\CMS\Model\SiteTree:
create_table_options:
MySQLDatabase: 'ENGINE=MyISAM'
extensions:
- "FulltextSearchable('Title, MenuTitle, Content, MetaDescription')"
- "SilverStripe\\ORM\\Search\\FulltextSearchable('Title', 'MenuTitle', 'Content', 'MetaDescription')"
```
When considering the search engine to use, full-text has some important limitations. This configuration can also be applied to `File`, however, unfortunately it does not support further customisation.
Expand All @@ -47,17 +47,17 @@ When considering the search engine to use, full-text has some important limitati
The following is an example configuration, where `ElasticSearch` extends the abstract `CustomSearchEngine` class:

```yaml
ExtensibleSearchPage:
nglasl\extensible\ExtensibleSearchPage:
custom_search_engines:
ElasticSearch: 'Elastic'
```

### Search Form

```yaml
Page_Controller:
PageController:
extensions:
- 'ExtensibleSearchExtension'
- 'nglasl\extensible\ExtensibleSearchExtension'
```

Using this, to display the search form that users interact with (from your template):
Expand All @@ -71,42 +71,42 @@ $SearchForm
These are important to help determine either popular content on your site, or whether content is difficult for users to locate. They're automatically enabled out of the box, however, can be disabled using the following:

```yaml
ExtensibleSearch:
nglasl\extensible\ExtensibleSearch:
enable_analytics: false
```

![analytics](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/images/extensible-search-analytics.png)
![analytics](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/client/images/extensible-search-analytics.png)

When triggering a search, appending `?analytics=false` to the URL will bypass the search analytics. This is fantastic for debugging.

#### Archiving

Depending on your search traffic, `/dev/tasks/ExtensibleSearchArchiveTask` may be used to archive past search analytics, for each search page. It would be recommended to trigger this on a schedule where possible.

![archives](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/images/extensible-search-archives.png)
![archives](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/client/images/extensible-search-archives.png)

![archive](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/images/extensible-search-archive.png)
![archive](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/client/images/extensible-search-archive.png)

### Search Suggestions

These are most effective alongside the search analytics (in which case they're automatically populated), and can be used to display either popular searches on your site, or search form autocomplete options. They're automatically enabled out of the box, however, can be disabled using the following:

```yaml
ExtensibleSearchSuggestion:
nglasl\extensible\ExtensibleSearchSuggestion:
enable_suggestions: false
```

![suggestions](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/images/extensible-search-suggestions.png)
![suggestions](https://raw.githubusercontent.com/nglasl/silverstripe-extensible-search/master/client/images/extensible-search-suggestions.png)

To enable autocomplete using the **approved** search suggestions..

```php
Requirements::javascript(EXTENSIBLE_SEARCH_PATH . '/javascript/extensible-search-suggestions.js');
Requirements::javascript('nglasl/silverstripe-extensible-search: client/javascript/extensible-search-suggestions.js');
// OPTIONAL.
Requirements::css('framework/thirdparty/jquery-ui-themes/smoothness/jquery-ui.min.css');
Requirements::javascript('framework/thirdparty/jquery-ui/jquery-ui.min.js');
Requirements::css('jquery-ui.min.css');
Requirements::javascript('jquery-ui.min.js');
```

### Smart Templating
Expand Down
14 changes: 0 additions & 14 deletions _config.php

This file was deleted.

4 changes: 2 additions & 2 deletions _config/routes.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: extensible-search-routes
---
Director:
SilverStripe\Control\Director:
rules:
extensible-search-api: 'ExtensibleSearchAPI'
extensible-search-api: 'nglasl\extensible\ExtensibleSearchAPI'
10 changes: 10 additions & 0 deletions _config/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: extensible-search-upgrade
---
SilverStripe\ORM\DatabaseAdmin:
classname_value_remapping:
ExtensibleSearch: 'nglasl\extensible\ExtensibleSearch'
ExtensibleSearchArchive: 'nglasl\extensible\ExtensibleSearchArchive'
ExtensibleSearchArchived: 'nglasl\extensible\ExtensibleSearchArchived'
ExtensibleSearchSuggestion: 'nglasl\extensible\ExtensibleSearchSuggestion'
ExtensibleSearchPage: 'nglasl\extensible\ExtensibleSearchPage'
27 changes: 27 additions & 0 deletions client/css/extensible-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

/**
* The extensible search specific styling.
* @author Nathan Glasl <nathan@symbiote.com.au>
*/

p.extensible-search.notice,
p.extensible-search.notification {
padding: 10px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}

p.extensible-search.notice {
background: #F0F8FC;
border: 1px solid #93CDE8;
}

p.extensible-search.notification {
background: #FFA84C;
border: 1px solid #FF7400;
}

#Form_EditForm_Suggestions input.approved {
cursor: pointer;
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
114 changes: 0 additions & 114 deletions code/controllers/ExtensibleSearchAPI.php

This file was deleted.

Loading

0 comments on commit b6d587f

Please sign in to comment.