diff --git a/.travis.yml b/.travis.yml index 1ffb05b..dd1a196 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_install: - composer validate install: - - composer update --prefer-dist + - composer install --prefer-dist - tests/Application/bin/console doctrine:schema:create --env=test -vvv --no-interaction - tests/Application/bin/console fos:elastica:reset --env=test -vvv --no-interaction diff --git a/README.md b/README.md index 3ba7e30..17da7b4 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Elastic search for Sylius. resource: "@LakionSyliusElasticSearchBundle/Resources/config/routing.yml" ``` -8. Configuration reference: +9. Configuration reference: ```yaml lakion_sylius_elastic_search: @@ -71,3 +71,14 @@ Elastic search for Sylius. product_price: type: price ``` + +10. ElasticSearch server parameters ( optional ): + + In order to change default ElasticSearch server parameters add this to `parameters.yml`: + ```yaml + fos_elastica_host: 127.0.0.1 # ElasticSearch host + fos_elastica_port: 9200 # ElasticSearch port + + ``` + + Default values are: `host 127.0.0.1, port 9200` diff --git a/composer.json b/composer.json index 9307021..d3ca5f7 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^5.6|^7.0", - "sylius/sylius": "dev-master", + "sylius/sylius": "^1.0@beta", "friendsofsymfony/elastica-bundle": "^4.0", "ongr/elasticsearch-dsl": "^2.0" diff --git a/src/Resources/config/app/config.yml b/src/Resources/config/app/config.yml index 9474c28..025835f 100644 --- a/src/Resources/config/app/config.yml +++ b/src/Resources/config/app/config.yml @@ -1,8 +1,11 @@ +imports: + - { resource: "parameters.yml" } + fos_elastica: clients: default: servers: - - { host: 127.0.0.1, port: 9200 } + - { host: '%fos_elastica_host%', port: '%fos_elastica_port%' } indexes: sylius: client: default diff --git a/src/Resources/config/app/parameters.yml b/src/Resources/config/app/parameters.yml new file mode 100644 index 0000000..c1ac6d1 --- /dev/null +++ b/src/Resources/config/app/parameters.yml @@ -0,0 +1,3 @@ +parameters: + fos_elastica_host: 127.0.0.1 + fos_elastica_port: 9200 diff --git a/tests/Application/app/config/config.yml b/tests/Application/app/config/config.yml index f3b761c..4b2ed3b 100644 --- a/tests/Application/app/config/config.yml +++ b/tests/Application/app/config/config.yml @@ -1,6 +1,8 @@ parameters: locale: "en_US" secret: "Three can keep a secret, if two of them are dead." + fos_elastica_host: 127.0.0.1 + fos_elastica_port: 9200 imports: - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" } @@ -22,7 +24,6 @@ framework: validation: { enable_annotations: true } templating: { engines: ["twig"] } default_locale: "%locale%" - trusted_proxies: ~ session: handler_id: ~ test: ~