Index: trunk/cgi-bin/search-rpc.cgi
===================================================================
--- trunk/cgi-bin/search-rpc.cgi	(revision 911)
+++ trunk/cgi-bin/search-rpc.cgi	(revision 925)
@@ -224,15 +224,27 @@
   } # args{cidr}
 
-  foreach (qw(custid description notes city) ) {
-    if ($args{$_}) {
-      push @fields, "s.$_";
-      if ($args{$_} =~ /^(EXACT|NOT):/) {
+  foreach my $sfield (qw(custid description notes city) ) {
+    if ($args{$sfield}) {
+      push @fields, "s.$sfield";
+      if ($args{$sfield} =~ /^(EXACT|NOT):/) {
         push @matchtypes, $mt{$1};
-        $args{$_} =~ s/^$1://;
+        $args{$sfield} =~ s/^$1://;
       } else {
         push @matchtypes, '~*';
       }
-      push @vals, $args{$_};
-    }
+      push @vals, $args{$sfield};
+    }
+  }
+
+  if ($args{parent_id}) {
+    # parent_id is always exact.  default to positive match
+    if ($args{parent_id} =~ /^NOT:/) {
+      $args{parent_id} =~ s/^NOT://;
+      push @matchtypes, '<>';
+    } else {
+      push @matchtypes, '=';
+    }
+    push @fields, 's.parent_id';
+    push @vals, $args{parent_id};
   }
 
@@ -349,4 +361,6 @@
 Not all fields are exposed for search.  For most purposes these should be sufficient.
 
+Most fields support EXACT: or NOT: prefixes on the search term to restrict the matches.
+
 =over 4
 
@@ -413,4 +427,8 @@
 To search for a free block, use the main RPC API's listFree or findAllocateFrom subs.
 
+=item parent_id
+
+Restrict to allocations in the given parent.
+
 =item order
 
