From dd32d0f966bc7f24f716e610d06a9ca8914fb935 Mon Sep 17 00:00:00 2001 From: Jay Hodgson Date: Tue, 10 Dec 2024 09:09:42 -0800 Subject: [PATCH] from code review --- .../sagebionetworks/web/client/presenter/SearchPresenter.java | 2 +- .../org/sagebionetworks/web/client/view/ProfileViewImpl.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sagebionetworks/web/client/presenter/SearchPresenter.java b/src/main/java/org/sagebionetworks/web/client/presenter/SearchPresenter.java index c4735213c9..da621a539a 100644 --- a/src/main/java/org/sagebionetworks/web/client/presenter/SearchPresenter.java +++ b/src/main/java/org/sagebionetworks/web/client/presenter/SearchPresenter.java @@ -293,7 +293,7 @@ private SearchQuery checkForJson(String queryString) { SearchQuery query = getBaseSearchQuery(); query.setQueryTerm( - Arrays.asList(queryString.replace("%20", " ").split(" ")) + Arrays.asList(queryString.replace("%20", " ").split("\\s+")) ); // if query parses into SearchQuery, use that, otherwise use it as a diff --git a/src/main/java/org/sagebionetworks/web/client/view/ProfileViewImpl.java b/src/main/java/org/sagebionetworks/web/client/view/ProfileViewImpl.java index 559ef61caa..5977c59980 100644 --- a/src/main/java/org/sagebionetworks/web/client/view/ProfileViewImpl.java +++ b/src/main/java/org/sagebionetworks/web/client/view/ProfileViewImpl.java @@ -14,6 +14,7 @@ import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; +import java.util.Arrays; import java.util.Collections; import org.gwtbootstrap3.client.ui.Alert; import org.gwtbootstrap3.client.ui.AnchorListItem; @@ -307,8 +308,9 @@ private String getCurrentProjectSearchJSON() { projectsOnly.setKey("node_type"); projectsOnly.setValue("project"); query.getBooleanQuery().add(projectsOnly); + query.setQueryTerm( - Collections.singletonList(projectSearchTextBox.getValue()) + Arrays.asList(projectSearchTextBox.getValue().split("\\s+")) ); query.writeToJSONObject(adapter); searchJSON = adapter.toJSONString();