Skip to content

Example for multi-locale and multi-site Setup #60

Answered by solverat
aarongerig asked this question in Q&A
Discussion options

You must be logged in to vote

There are several ways to go:

Context

Use multiple context blocks for each site. This allows you to completely configure your DS setup independently of each site. Depending on you're frontend request (/dynamic-search/context1/search?q=123 or /dynamic-search/context2/search?q=123 you're able to fetch site based results.

Field Flags

Add two fields to each of your definition (siteId and locale). So every document, you're going to index, is identifiable by those fields. In your output channel, you're then able to filter your result.

Example (ElasticSearch Provider):

$locale = $this->requestStack->getMainRequest()->getLocale();

$localeQuery = new TermQuery('locale', $locale);

$boolQuery = new 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aarongerig
Comment options

Answer selected by aarongerig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants