File tree Expand file tree Collapse file tree
Documentation/Development Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ =============
2+ Best Practice
3+ =============
4+
5+ Optimize Page Indexing
6+ ======================
7+
8+ Indexing of `pages ` is usually done via this extensions `PageIndexer ` which
9+ determines a pages content by crawling its URL and extracting everything between
10+ the two magic markers `<!--TYPO3SEARCH_begin--> ` and `<!--TYPO3SEARCH_end--> `.
11+ When fetching the URL the header `X-Tx-Solr-Iq ` is added to the request, which
12+ is (among other things) disabling all caches.
13+
14+ To reduce crawling runtimes you might wanna disable the rather expensive
15+ generation of navigation structures such as main and footer menus that you've
16+ defined for your `page ` object in TypoScript.
17+
18+ You can do so by creating a TypoScript condition that unsets all sorts of
19+ non-content elements. Like this for example:
20+
21+ .. code-block :: typoscript
22+
23+ [request && traverse(request.getHeaders()['x-tx-solr-iq'], '0')]
24+ page.10.dataProcessing >
25+ page.10.variables >
26+ page.10.variables {
27+ content < styles.content.get
28+ content.select.where = {#colPos}=0
29+ contentMarginal < styles.content.get
30+ contentMarginal.select.where = {#colPos}=1
31+ }
32+ [global]
33+
34+ You should notice a significant difference right away:
35+
36+ .. code-block :: bash
37+
38+ bin/typo3 solr:queue:index -n -a 1 -s < site>
39+
40+ If not: go to the TYPO3 backend and check the `page ` object definition in the
41+ TypoScript object browser with that condition being activated to see what it
42+ looks like now.
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ There are many ways to extend and hook into EXT:solr to customize EXT:solr for y
1212
1313 Indexing
1414 Backend
15+ BestPractice
1516 Environment
1617 CI
1718 CodeStructure
You can’t perform that action at this time.
0 commit comments