Index: trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 9020)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 9021)
@@ -10,4 +10,5 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -22,4 +23,5 @@
 import org.openstreetmap.josm.actions.search.PushbackTokenizer.Token;
 import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -1422,5 +1424,5 @@
         }
 
-        protected abstract Bounds getBounds();
+        protected abstract Collection<Bounds> getBounds();
 
         @Override
@@ -1429,6 +1431,14 @@
                 return false;
             else if (osm instanceof Node) {
-                Bounds bounds = getBounds();
-                return bounds != null && bounds.contains(((Node) osm).getCoor());
+                Collection<Bounds> allBounds = getBounds();
+                if (allBounds != null) {
+                    LatLon coor = ((Node) osm).getCoor();
+                    for (Bounds bounds: allBounds) {
+                        if (bounds.contains(coor)) {
+                            return true;
+                        }
+                    }
+                }
+                return false;
             } else if (osm instanceof Way) {
                 Collection<Node> nodes = ((Way) osm).getNodes();
@@ -1447,4 +1457,8 @@
     public static class InDataSourceArea extends InArea {
 
+        /**
+         * Constructs a new {@code InDataSourceArea}.
+         * @param all if true, all way nodes or relation members have to be within source area; if false, one suffices.
+         */
         public InDataSourceArea(boolean all) {
             super(all);
@@ -1452,7 +1466,7 @@
 
         @Override
-        protected Bounds getBounds() {
+        protected Collection<Bounds> getBounds() {
             return Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
-                    ? null : new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D());
+                    ? null : Main.main.getCurrentDataSet().getDataSourceBounds();
         }
 
@@ -1473,9 +1487,9 @@
 
         @Override
-        protected Bounds getBounds() {
+        protected Collection<Bounds> getBounds() {
             if (!Main.isDisplayingMapView()) {
                 return null;
             }
-            return Main.map.mapView.getRealBounds();
+            return Collections.singleton(Main.map.mapView.getRealBounds());
         }
 
