Git commit c37f8d7023c3e486762af0379e36708d7eb99cea by Till Adam. Committed on 22/01/2013 at 18:31. Pushed by tilladam into branch 'KDE/4.10'. Use a faster contains expression for "start of word" matches. For the special case of address completion, we are really only interested in matching at the start of various parts of the name, first name, email, etc. So for that case, use bif:contains('foo*') rather than the much more expensive regexp match. Speeds up addressee completion something fierce for a minor loss in functionality, namely arbitrary substring matching. M +5 -2 akonadi/contact/contactsearchjob.cpp http://commits.kde.org/kdepimlibs/c37f8d7023c3e486762af0379e36708d7eb99cea diff --git a/akonadi/contact/contactsearchjob.cpp b/akonadi/contact/contact= searchjob.cpp index 7b71b07..7984d88 100644 --- a/akonadi/contact/contactsearchjob.cpp +++ b/akonadi/contact/contactsearchjob.cpp @@ -71,8 +71,11 @@ static QString containsQueryString( bool doWholeWordSear= ch, bool matchWordBounda if ( doWholeWordSearch ) { return QString::fromLatin1( "?v bif:contains \"'%1'\" . " ); } else { - return QString::fromLatin1( "FILTER regex(str(?v), \"%1\", \"i\")" ) - .arg( matchWordBoundary? QLatin1String( "\\\\b%1" ) : QLatin1Strin= g( "%1" ) ); + if ( matchWordBoundary ) { + return QString::fromLatin1( "?v bif:contains \"'%1*'\" . " ); + } else { + return QString::fromLatin1( "FILTER regex(str(?v), \"%1\", \"i\"= )" ); + } } } =20