Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/searchpanel/DefaultSearchPanel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/searchpanel/DefaultSearchPanel.java	(revision 47417)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/searchpanel/DefaultSearchPanel.java	(revision 47418)
@@ -1336,7 +1336,29 @@
                 if( selectedRows.length > maxfeatures ) {
                     this.taskStatusController.message("Too many items selecteds");
                 }
-		if (this.tabResults.getSelectedIndex() == 1) {
+		if (this.tabResults.getSelectedIndex() == 0) {
+                    try {
+                            FeatureType ftype = this.store.getDefaultFeatureType();
+                            ExpressionBuilder builder = ExpressionUtils.createExpressionBuilder();
+                            List<Feature> features = ((SimpleFeaturesTableModelImpl) this.tblResults.getModel()).getFeatures();
+                            for (int i = 0; i < selectedRows.length && i<maxfeatures ; i++) {
+                                Feature feature = features.get(selectedRows[i]);
+                                for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) {
+                                        builder.or(
+                                                builder.eq(
+                                                        builder.column(attrdesc.getName()),
+                                                        builder.constant(feature.get(attrdesc.getName()))
+                                                )
+                                        );
+                                }
+                            }
+                            Expression filter = ExpressionUtils.createExpression(builder.toString());                            
+                            return filter;
+                    } catch (Exception ex) {
+                            LOGGER.warn("Can't build search for the selected feature.", ex);
+                            return null;
+                    }
+		} else {
 			if (this.currentPostProcess == null) {
 				return null;
 			}
@@ -1347,7 +1369,7 @@
                                     Feature feature = features.get(selectedRows[i]);
                                     FeatureType ftype = this.postProcessStore.getDefaultFeatureType();
                                     for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) {
-                                            builder.and(
+                                            builder.or(
                                                     builder.eq(
                                                             builder.column(attrdesc.getName()),
                                                             builder.constant(feature.get(attrdesc.getName()))
@@ -1361,28 +1383,6 @@
 				LOGGER.warn("Can't build search for the selected feature.", ex);
 				return null;
 			}
-		} else {
-                    try {
-                            FeatureType ftype = this.store.getDefaultFeatureType();
-                            ExpressionBuilder builder = ExpressionUtils.createExpressionBuilder();
-                            List<Feature> features = ((SimpleFeaturesTableModelImpl) this.tblResults.getModel()).getFeatures();
-                            for (int i = 0; i < selectedRows.length && i<maxfeatures ; i++) {
-                                Feature feature = features.get(selectedRows[i]);
-                                for (FeatureAttributeDescriptor attrdesc : ftype.getPrimaryKey()) {
-                                        builder.and(
-                                                builder.eq(
-                                                        builder.column(attrdesc.getName()),
-                                                        builder.constant(feature.get(attrdesc.getName()))
-                                                )
-                                        );
-                                }
-                            }
-                            Expression filter = ExpressionUtils.createExpression(builder.toString());                            
-                            return filter;
-                    } catch (Exception ex) {
-                            LOGGER.warn("Can't build search for the selected feature.", ex);
-                            return null;
-                    }
 		}
         }
         
