File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/Umbraco.Web/umbraco.presentation/umbraco/Search Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,11 @@ public void ProcessRequest(HttpContext context)
60
60
}
61
61
else
62
62
{
63
- var operation = criteria . Field ( "__nodeName" , txt . MultipleCharacterWildcard ( ) ) ;
63
+ var words = txt . Split ( new [ ] { ' ' } , StringSplitOptions . RemoveEmptyEntries ) . Select ( w => w . ToLower ( ) . MultipleCharacterWildcard ( ) ) . ToList ( ) ;
64
+ var operation = criteria . GroupedOr ( new [ ] { "__nodeName" } , new [ ] { words [ 0 ] } ) ;
65
+ words . RemoveAt ( 0 ) ;
66
+ foreach ( var word in words )
67
+ operation = operation . And ( ) . GroupedOr ( new [ ] { "__nodeName" } , new [ ] { word } ) ;
64
68
65
69
// ensure the user can only find nodes they are allowed to see
66
70
if ( UmbracoContext . Current . UmbracoUser . StartNodeId > 0 )
You can’t perform that action at this time.
0 commit comments