@zend_lucene @elastic @test
Feature: Contexts
In order to be able to have different indexes for the back and front office
The MassiveSearchBundle should provide a method to map different contexts
Background:
Given the entity "Product" exists:
"""
"""
And I purge the index "animal"
And I purge the index "animal_website"
Scenario Outline: Searching in locale with context index
Given the following "Product" objects have been indexed
"""
[
{ "id": 1, "title": "Giraffe", "body": "Long neck", "date": "2015-01-01", "url": "http://foo", "locale": "fr", "image": "foo.png" },
{ "id": 2, "title": "Lion", "body": "Big mane", "date": "2015-01-01", "url": "http://lion.com", "locale": "fr", "image": "foo.png" },
{ "id": 3, "title": "Lion", "body": "Big mane", "date": null, "url": "http://lion.com", "locale": "fr", "image": "foo.png" }
]
"""
When I search for "" in locale "" with index ""
Then there should be "" results
Examples:
| animal | locale | nbResults | index |
| Giraffe | fr | 1 | animal_website |
| Giraffe | fr | 1 | animal |
Scenario: Search with no index
Given the following "Product" objects have been indexed
"""
[
{ "id": 3, "title": "German Hyena", "body": "Laughs", "date": "2015-01-01", "url": "http://hyena.com", "locale": "de", "image": "foo.png" },
{ "id": 4, "title": "French Hyena", "body": "Laughs", "date": "2015-01-01", "url": "http://hyena.com", "locale": "fr", "image": "foo.png" }
]
"""
When I search for "Hyena"
Then there should be "4" results