[TYPO3-v4] Improving/changing BE search

Dmitry Dulepov dmitry.dulepov at gmail.com
Sat May 7 12:29:46 CEST 2011


Hi!

Small status update.

I made the patch and it is currently being tested in production. If 
everything goes ok for a week, I will create an issue on Forge and post a 
patch there. I do not want to do it right now because I tweak it from time 
to time.

So here is what I did with the patch:
- fix search box: in the current TYPO3 version it searches only 4 level 
deep from the very first mount point (or pid=0 for admin). Now it searches 
everywhere. This solves the issue when the page exists but cannot be found.
- remove LIKE for numeric searches. That also removes necessity to XCLASS 
the typo3/class.db_list.inc in DBAL.
- search numeric fields only using '=' and only if it is uid field or 
'eval' has 'int'
- search only fields declared ['ctrl']['searchField']. This excludes fields 
like TSConfig.
- fields can say that they want a 'nocase' search or a search only in the 
current pid (useful in certain custom cases) or add an extra WHERE (for 
example, tt_content's 'bodytext' makes no sense if CType is not 'text' or 
'textpic' and 'pi_flexform' should be searched only for 'list' CType)
- search is enabled for most BE tables (titles, email, description, url and 
name fields)

Before patching I had searches run for nearly 5 minutes in my BE. Now it 
takes 2-3 seconds. Of course, this may vary on different systems but in 
general this is a great improvement over the old search.

In further plans:
- allow to search only from the beginning of the word by prefixing the word 
with ^ character
- allow to search for the exact word by prefixing the word with ! character

Both those could speed up and enhance the search even more. I am not sure 
if that will be implemented in the first patch. We will see.

Dmitry.

Dmitry Dulepov wrote:
> Recently I came over major issues with BE search in one of my private
> projects and I have an idea to change how BE search works. Since I have
> two options (do it locally or for everybody), I want to know if the
> community is ok with my idea or not.

-- 
Dmitry 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