[TYPO3-v4] Improving backend search for 4.4 and 4.5

Dmitry Dulepov dmitry.dulepov at gmail.com
Mon Sep 19 13:09:51 CEST 2011


Hi!

Ernesto Baschny [cron IT] wrote:
> Speed improvements are welcome in 4.5. If they of course don't break
> backwards compatibility or change the user interface.

That's the point, they break it in a certain way. It needs explanation.

Before the patch TYPO3 did the following:
- for each table
	- add uid to search fields (even if you search for a string)
	- for each field in the table
		- if it is any text field, add it to search
	- do "LIKE '%'" . $field . "%'"
- limit pids to current pid + 4 sublevels, don't tell anyone about it

If you have 30 tables in the database you get a ton of LIKE statments 
connected by OR. The whole thing cannot use indexes. On a 10000 pages you 
get a really long time search.

Patch does this:
- for each table
	- add uid to search only if searching for numbers
	- look if there is a 'searchField' in 'ctrl' of the $TCA for table
		- if 'searchFields' exist
			- for each field
				- add it to search
	- do "'LIKE ' . $field . '%'"
- limit to pid(s) only of the user said so explicitly in the List module

This runs much faster because it uses only fields, that are really 
searchable. Also it can uses indexes on text fields. But you see the 
drawback: no "searchFields" in the $TCA for a table means no search of that 
table. It is easy to fix but extensions have to make such fixes if their 
table should be searched. On the other hand it is also good because not 
every table should be searched (there are many tables without user-readable 
data).

So it can be seen as a breaking change.

> People wanting new features (even if they are enhancements of current
> features) should try to upgrade to the latest release as soon as it is
> out. Every 6 months there is a new release anyway.

People – yes but customers has to be convinced because upgrade costs them 
money. So many companies just backport good changes and use the same 4.4 
branch with certain good changes instead of a full upgrade.

-- 
Dmitry "itoldyou" Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/



More information about the TYPO3-project-v4 mailing list