Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

[TASK] Improve language overlay handling for records #11

Closed
wants to merge 2 commits into from
Closed

[TASK] Improve language overlay handling for records #11

wants to merge 2 commits into from

Conversation

dmitryd
Copy link
Contributor

@dmitryd dmitryd commented Oct 28, 2015

Solr record indexer does not handle language overlay efficiently and does not support content fallback.

Firsts, the cache for language information is not kept across instances of the indexer. Each new record
requires a new instance of the indexer but language information does not change between creation of
indexer instances. Language information is obtained by instantiating TSFE and parsing TS templates.
This can take 0.5-2 seconds depending on the amount of TypoScript. It makes sense to cache this
information statically. It helps to shorten indexing times dramatically.

Secondly, if there is content overlay, than records like news will be properly overlayed by the
corrsponding news plugin (i.e. you can see de_DE record instead of de_CH if de_CH does not exist) but
solr indexer will only give a record in the default language in such case, which is unexpected result
for the customer.

This commit fixes both issues. It is implemented as a single change because it is highly connected
code.

Dmitry Dulepov added 2 commits October 28, 2015 12:41
Solr record indexer does not handle language overlay efficiently and does not support content fallback.

Firsts, the cache for language information is not kept across instances of the indexer. Each new record
requires a new instance of the indexer but language information does not change between creation of
indexer instances. Language information is obtained by instantiating TSFE and parsing TS templates.
This can take 0.5-2 seconds depending on the amount of TypoScript. It makes sense to cache this
information statically. It helps to shorten indexing times dramatically.

Secondly, if there is content overlay, than records like news will be properly overlayed by the
corrsponding news plugin (i.e. you can see de_DE record instead of de_CH if de_CH does not exist) but
solr indexer will only give a record in the default language in such case, which is unexpected result
for the customer.

This commit fixes both issues. It is implemented as a single change because it is highly connected
code.
$GLOBALS[TSFE] needs to be set up correctly for each language when indexing records.
However Classes/IndexQueue/Indexer.php sets it to the current language only in certain
cases.
@dmitryd
Copy link
Contributor Author

dmitryd commented Apr 4, 2016

It would be nice to have these improvements. They seriously speed up solr and lower CPU usage on the server.

@dmitryd
Copy link
Contributor Author

dmitryd commented Apr 4, 2016

Wrong place :( Here is the proper one: TYPO3-Solr/ext-solr#310

@dmitryd dmitryd closed this Apr 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
1 participant