Madmatt\ElasticProxy\ElasticsearchController
Silverstripe -> Elastic App Search proxy
Allows user to hide the 'public' search API key and endpoint URL, to prevent malicious usage or direct attack of the
Elastic Enterprise Search or Elastic App Search instance.
Requires the following environment variables to be set alongside other typical ones like SS_DATABASE_USERNAME:
- APP_SEARCH_ENDPOINT: The full URL (without trailing slash) to your Elastic endpoint e.g. https://deploy-sha.ent-search.aws-region-code.aws.cloud.es.io
- APP_SEARCH_API_SEARCH_KEY: The public search key (begins with `search-`) as provided by the Elastic interface
- APP_SEARCH_ENGINE_PREFIX: The prefix for the Elastic engine that you expect to query
- APP_SEARCH_ENGINE_INDEX_NAME: The name of the Elastic index that you expect to query (defaults to 'content')
See README.md and docs/configuration.md for full installation and configuration details.
Synopsis
- // members
- private static bool $enabled = false;
- private static integer $curl_connect_timeout = 2;
- private static integer $curl_timeout = 5;
- private static array $allow_list = ;
- // methods
- public string index()
Hierarchy
Extends
- SilverStripe\Control\Controller
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $allow_list — array
- $curl_connect_timeout — int
- $curl_timeout — int
- $enabled — Madmatt\ElasticProxy\bool
Methods
public
- index() — Handle all possible error / edge cases, then passthru to Elastic for rendering of search results.