diff --git a/.editorconfig b/.editorconfig index 9d24928..0741b16 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,7 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[{*.yml}] +[*.yml] indent_size = 2 indent_style = space diff --git a/_config/adaptors.yml b/_config/adaptors.yml new file mode 100644 index 0000000..9c66178 --- /dev/null +++ b/_config/adaptors.yml @@ -0,0 +1,24 @@ +--- +Name: discoverer-bifrost-adaptors +After: discoverer-adaptors +Only: + envvarset: 'BIFROST_QUERY_API_KEY' +--- +SilverStripe\Core\Injector\Injector: + SilverStripe\Discoverer\Query\Facet\FacetAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Query\Facet\FacetAdaptor + SilverStripe\Discoverer\Query\Filter\CriteriaAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Query\Filter\CriteriaAdaptor + SilverStripe\Discoverer\Query\Filter\CriterionAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Query\Filter\CriterionAdaptor + SilverStripe\Discoverer\Service\Interfaces\ProcessAnalyticsAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Service\Adaptors\ProcessAnalyticsAdaptor + SilverStripe\Discoverer\Service\Interfaces\QuerySuggestionAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Service\Adaptors\QuerySuggestionAdaptor + SilverStripe\Discoverer\Service\Interfaces\SearchAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Service\Adaptors\SearchAdaptor + SilverStripe\Discoverer\Service\Interfaces\SpellingSuggestionAdaptor: + class: SilverStripe\DiscovererElasticEnterprise\Service\Adaptors\SpellingSuggestionAdaptor + +SilverStripe\DiscovererElasticEnterprise\Service\Adaptors\BaseAdaptor: + prefix_env_var: 'BIFROST_ENGINE_PREFIX' diff --git a/_config/config.yml b/_config/config.yml deleted file mode 100644 index 162f49b..0000000 --- a/_config/config.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -Name: discoverer-bifrost -Only: - envvarset: 'BIFROST_QUERY_API_KEY' ---- -SilverStripe\Core\Injector\Injector: - SilverStripe\Discoverer\Query\Facet\FacetAdaptor: - class: SilverStripe\DiscovererElasticEnterprise\Query\Facet\FacetAdaptor - SilverStripe\Discoverer\Query\Filter\CriteriaAdaptor: - class: SilverStripe\DiscovererElasticEnterprise\Query\Filter\CriteriaAdaptor - SilverStripe\Discoverer\Query\Filter\CriterionAdaptor: - class: SilverStripe\DiscovererElasticEnterprise\Query\Filter\CriterionAdaptor - SilverStripe\Discoverer\Service\SearchServiceAdaptor: - class: SilverStripe\DiscovererElasticEnterprise\Service\SearchServiceAdaptor - Elastic\EnterpriseSearch\Client.searchClient: - factory: SilverStripe\DiscovererBifrost\Service\ClientFactory - constructor: - host: '`BIFROST_ENDPOINT`' - token: '`BIFROST_QUERY_API_KEY`' - http_client: '%$GuzzleHttp\Client' - Elastic\EnterpriseSearch\AppSearch\Request\Search: - class: SilverStripe\DiscovererBifrost\Service\Requests\Search - Elastic\EnterpriseSearch\AppSearch\Request\LogClickthrough: - class: SilverStripe\DiscovererBifrost\Service\Requests\ClickPost - Elastic\EnterpriseSearch\AppSearch\Request\QuerySuggestion: - class: SilverStripe\DiscovererBifrost\Service\Requests\QuerySuggestion - -SilverStripe\DiscovererElasticEnterprise\Service\SearchServiceAdaptor: - prefix_env_var: 'BIFROST_ENGINE_PREFIX' diff --git a/_config/factory.yml b/_config/factory.yml new file mode 100644 index 0000000..5020887 --- /dev/null +++ b/_config/factory.yml @@ -0,0 +1,12 @@ +--- +Name: discoverer-bifrost-factory +Only: + envvarset: 'BIFROST_QUERY_API_KEY' +--- +SilverStripe\Core\Injector\Injector: + Elastic\EnterpriseSearch\Client.searchClient: + factory: SilverStripe\DiscovererBifrost\Service\ClientFactory + constructor: + host: '`BIFROST_ENDPOINT`' + token: '`BIFROST_QUERY_API_KEY`' + http_client: '%$GuzzleHttp\Client' diff --git a/_config/requests.yml b/_config/requests.yml new file mode 100644 index 0000000..c3cbab0 --- /dev/null +++ b/_config/requests.yml @@ -0,0 +1,12 @@ +--- +Name: discoverer-bifrost-requests +Only: + envvarset: 'BIFROST_QUERY_API_KEY' +--- +SilverStripe\Core\Injector\Injector: + Elastic\EnterpriseSearch\AppSearch\Request\Search: + class: SilverStripe\DiscovererBifrost\Service\Requests\Search + Elastic\EnterpriseSearch\AppSearch\Request\LogClickthrough: + class: SilverStripe\DiscovererBifrost\Service\Requests\ClickPost + Elastic\EnterpriseSearch\AppSearch\Request\QuerySuggestion: + class: SilverStripe\DiscovererBifrost\Service\Requests\QuerySuggestion