-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interface changes for SearchService & Suggestions. Support spelling s…
…uggestions (#21)
- Loading branch information
1 parent
47e7feb
commit 1ebe7fc
Showing
16 changed files
with
209 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
Name: discoverer-adaptors | ||
--- | ||
SilverStripe\Core\Injector\Injector: | ||
SilverStripe\Discoverer\Service\Interfaces\ProcessAnalyticsAdaptor: | ||
class: SilverStripe\Discoverer\Service\Adaptors\ProcessAnalyticsAdaptor | ||
SilverStripe\Discoverer\Service\Interfaces\QuerySuggestionAdaptor: | ||
class: SilverStripe\Discoverer\Service\Adaptors\QuerySuggestionAdaptor | ||
SilverStripe\Discoverer\Service\Interfaces\SearchAdaptor: | ||
class: SilverStripe\Discoverer\Service\Adaptors\SearchAdaptor | ||
SilverStripe\Discoverer\Service\Interfaces\SpellingSuggestionAdaptor: | ||
class: SilverStripe\Discoverer\Service\Adaptors\SpellingSuggestionAdaptor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
Name: search-analytics | ||
Name: discoverer-analytics | ||
After: | ||
- requestprocessors | ||
Only: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Adaptors; | ||
|
||
use BadMethodCallException; | ||
use SilverStripe\Discoverer\Analytics\AnalyticsData; | ||
use SilverStripe\Discoverer\Service\Interfaces\ProcessAnalyticsAdaptor as ProcessAnalyticsAdaptorInterface; | ||
|
||
class ProcessAnalyticsAdaptor implements ProcessAnalyticsAdaptorInterface | ||
{ | ||
|
||
public function process(AnalyticsData $analyticsData): void | ||
{ | ||
throw new BadMethodCallException('Analytics adaptor has not been implemented'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Adaptors; | ||
|
||
use BadMethodCallException; | ||
use SilverStripe\Discoverer\Query\Suggestion; | ||
use SilverStripe\Discoverer\Service\Interfaces\QuerySuggestionAdaptor as QuerySuggestionAdaptorInterface; | ||
use SilverStripe\Discoverer\Service\Results\Suggestions; | ||
|
||
class QuerySuggestionAdaptor implements QuerySuggestionAdaptorInterface | ||
{ | ||
|
||
public function process(Suggestion $suggestion, string $indexName): Suggestions | ||
{ | ||
throw new BadMethodCallException('Query suggestion adaptor has not been implemented'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Adaptors; | ||
|
||
use BadMethodCallException; | ||
use SilverStripe\Discoverer\Query\Query; | ||
use SilverStripe\Discoverer\Service\Interfaces\SearchAdaptor as SearchAdaptorInterface; | ||
use SilverStripe\Discoverer\Service\Results\Results; | ||
|
||
class SearchAdaptor implements SearchAdaptorInterface | ||
{ | ||
|
||
public function process(Query $query, string $indexName): Results | ||
{ | ||
throw new BadMethodCallException('Search adaptor has not been implemented'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Adaptors; | ||
|
||
use BadMethodCallException; | ||
use SilverStripe\Discoverer\Query\Suggestion; | ||
use SilverStripe\Discoverer\Service\Interfaces\SpellingSuggestionAdaptor as SpellingSuggestionAdaptorInterface; | ||
use SilverStripe\Discoverer\Service\Results\Suggestions; | ||
|
||
class SpellingSuggestionAdaptor implements SpellingSuggestionAdaptorInterface | ||
{ | ||
|
||
public function process(Suggestion $suggestion, string $indexName): Suggestions | ||
{ | ||
throw new BadMethodCallException('Spelling suggestion adaptor has not been implemented'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Interfaces; | ||
|
||
use SilverStripe\Discoverer\Analytics\AnalyticsData; | ||
|
||
interface ProcessAnalyticsAdaptor | ||
{ | ||
|
||
public function process(AnalyticsData $analyticsData): void; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Interfaces; | ||
|
||
use SilverStripe\Discoverer\Query\Suggestion; | ||
use SilverStripe\Discoverer\Service\Results\Suggestions; | ||
|
||
interface QuerySuggestionAdaptor | ||
{ | ||
|
||
public function process(Suggestion $suggestion, string $indexName): Suggestions; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Interfaces; | ||
|
||
use SilverStripe\Discoverer\Query\Query; | ||
use SilverStripe\Discoverer\Service\Results\Results; | ||
|
||
interface SearchAdaptor | ||
{ | ||
|
||
public function process(Query $query, string $indexName): Results; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Discoverer\Service\Interfaces; | ||
|
||
use SilverStripe\Discoverer\Query\Suggestion; | ||
use SilverStripe\Discoverer\Service\Results\Suggestions; | ||
|
||
interface SpellingSuggestionAdaptor | ||
{ | ||
|
||
public function process(Suggestion $suggestion, string $indexName): Suggestions; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
templates/SilverStripe/Discoverer/Service/Results/Suggestions.ss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters