diff --git a/inc/fulltext.php b/inc/fulltext.php
index fd974c949ab149eb704038a162472701ab4b5d97..e8b31b201fbc9ac9d523c7a3a75e1dbe706a19a4 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -49,6 +49,15 @@ function ft_pageSearch($query,&$poswords){
     $hidden = array_filter(array_keys($docs),'isHiddenPage');
     $not = array_merge($not,$hidden);
 
+    // filter unmatched namespaces
+    if(!empty($q['ns'])) {
+        foreach($docs as $key => $val) {
+            if(!preg_match('/^'.$q['ns'].'/',$key)) {
+                unset($docs[$key]);
+            }
+        }
+    }
+
     // remove negative matches
     foreach($not as $n){
         unset($docs[$n]);
@@ -254,10 +263,17 @@ function ft_queryParser($query){
 
     $q = array();
     $q['query']   = $query;
+    $q['ns']      = '';
     $q['phrases'] = array();
     $q['and']     = array();
     $q['not']     = array();
 
+    // strip namespace from query
+    if(preg_match('/([^@]*)@([^@]*)/',$query,$match))  {
+        $query = $match[1];
+        $q['ns'] = $match[2];
+    }
+
     // handle phrase searches
     while(preg_match('/"(.*?)"/',$query,$match)){
         $q['phrases'][] = $match[1];
diff --git a/inc/html.php b/inc/html.php
index 6d0b7e1162547fbdda36ea7dc86b063693713ef4..928da9cef1cd7f521a4c24216dde44428bb537bb 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -365,6 +365,18 @@ function html_search(){
   print p_locale_xhtml('searchpage');
   flush();
 
+  //check if search is restricted to namespace
+  if(preg_match('/([^@]*)@([^@]*)/',$QUERY,$match)) {
+      $id = cleanID($match[1]);
+      if(empty($id)) {
+        print '<div class="nothing">'.$lang['nothingfound'].'</div>';
+        flush();
+        return;
+      }
+  } else {
+      $id = cleanID($QUERY);
+  }
+
   //show progressbar
   print '<div class="centeralign" id="dw__loading">';
   print '<br /></div>';
@@ -375,7 +387,8 @@ function html_search(){
 
   //do quick pagesearch
   $data = array();
-  $data = ft_pageLookup(cleanID($QUERY));
+
+  $data = ft_pageLookup($id);
   if(count($data)){
     sort($data);
     print '<div class="search_quickresult">';