Index: trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 16580)
+++ trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 16581)
@@ -127,5 +127,5 @@
     public static class CoreSimpleMatchFactory implements SimpleMatchFactory {
         private final Collection<String> keywords = Arrays.asList("id", "version", "type", "user", "role",
-                "changeset", "nodes", "ways", "tags", "areasize", "waylength", "modified", "deleted", "selected",
+                "changeset", "nodes", "ways", "members", "tags", "areasize", "waylength", "modified", "deleted", "selected",
                 "incomplete", "untagged", "closed", "new", "indownloadedarea",
                 "allindownloadedarea", "timestamp", "nth", "nth%", "hasRole", "preset");
@@ -173,4 +173,6 @@
                     case "ways":
                         return new WayCountRange(tokenizer);
+                    case "members":
+                        return new MemberCountRange(tokenizer);
                     case "tags":
                         return new TagCountRange(tokenizer);
@@ -1435,4 +1437,32 @@
     }
 
+    /*
+     * Matches relations with a certain number of members
+     */
+    private static class MemberCountRange extends RangeMatch {
+        MemberCountRange(Range range) {
+            super(range);
+        }
+
+        MemberCountRange(PushbackTokenizer tokenizer) throws SearchParseError {
+            this(tokenizer.readRange(tr("Range of numbers expected")));
+        }
+
+        @Override
+        protected Long getNumber(OsmPrimitive osm) {
+            if (osm instanceof Relation) {
+                Relation r = (Relation) osm;
+                return (long) r.getMembersCount();
+            } else {
+                return null;
+            }
+        }
+
+        @Override
+        protected String getString() {
+            return "members";
+        }
+    }
+
     /**
      * Matches objects with a number of tags in given range
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java	(revision 16580)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java	(revision 16581)
@@ -383,5 +383,5 @@
                 .addKeyword("ways:<i>3-</i>", "ways:", tr("nodes with at least 3 referring ways, or relations containing at least 3 ways"))
                 .addKeyword("tags:<i>5-10</i>", "tags:", tr("objects having 5 to 10 tags"))
-                .addKeyword("role:", "role:", tr("objects with given role in a relation"))
+                .addKeyword("members:<i>2</i>", "members:", tr("relations with 2 members"))
                 .addKeyword("areasize:<i>-100</i>", "areasize:", tr("closed ways with an area of 100 m\u00b2"))
                 .addKeyword("waylength:<i>200-</i>", "waylength:", tr("ways with a length of 200 m or more")),
@@ -399,4 +399,5 @@
                 .addKeyword("child <i>expr</i>", "child ", tr("all children of objects matching the expression"), "child building")
                 .addKeyword("parent <i>expr</i>", "parent ", tr("all parents of objects matching the expression"), "parent bus_stop")
+                .addKeyword("role:", "role:", tr("objects with given role in a relation"))
                 .addKeyword("hasRole:<i>stop</i>", "hasRole:", tr("relation containing a member of role <i>stop</i>"))
                 .addKeyword("role:<i>stop</i>", "role:", tr("objects being part of a relation as role <i>stop</i>"))
