Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract ElasticSearch host and port and fix sylius version requirement #30

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion src/Resources/config/app/config.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/config/app/parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
fos_elastica_host: 127.0.0.1
fos_elastica_port: 9200
3 changes: 2 additions & 1 deletion tests/Application/app/config/config.yml
Original file line number Diff line number Diff line change
@@ -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" }
Expand All @@ -22,7 +24,6 @@ framework:
validation: { enable_annotations: true }
templating: { engines: ["twig"] }
default_locale: "%locale%"
trusted_proxies: ~
session:
handler_id: ~
test: ~
Expand Down