diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java index a30745862ec..6dbf994f7e0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/SearchCoordinatorSvcImpl.java @@ -483,6 +483,7 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc { myResourceType = theResourceType; myCompletionLatch = new CountDownLatch(1); mySearchRuntimeDetails = new SearchRuntimeDetails(mySearch.getUuid()); + mySearchRuntimeDetails.setQueryString(theParams.toNormalizedQueryString(theCallingDao.getContext())); } public SearchRuntimeDetails getSearchRuntimeDetails() { @@ -703,6 +704,7 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc { } }); +// FIXME: JA interceptor ourLog.info("Have completed search for [{}{}] and found {} resources in {}ms - Status is {}", mySearch.getResourceType(), mySearch.getSearchQueryString(), mySyncedPids.size(), sw.getMillis(), mySearch.getStatus()); } catch (Throwable t) { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UniqueSearchParamTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UniqueSearchParamTest.java index 83060ae0f5f..402973f59ad 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UniqueSearchParamTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UniqueSearchParamTest.java @@ -460,6 +460,7 @@ public class FhirResourceDaoR4UniqueSearchParamTest extends BaseJpaR4Test { .setValue(new BooleanType(true)); mySearchParameterDao.create(sp); mySearchParamRegistry.forceRefresh(); + ourLog.info(myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(sp)); // Now create matching/non-matching resources Patient pt = new Patient(); diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java index 506817d93a8..95a888b60a8 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/search/SearchRuntimeDetails.java @@ -11,6 +11,7 @@ public class SearchRuntimeDetails { private StopWatch myQueryStopwatch; private int myFoundMatchesCount; private boolean myLoadSynchronous; + private String myQueryString; public SearchRuntimeDetails(String theSearchUuid) { mySearchUuid = theSearchUuid; @@ -43,4 +44,12 @@ public class SearchRuntimeDetails { public boolean getLoadSynchronous() { return myLoadSynchronous; } + + public void setQueryString(String theQueryString) { + myQueryString = theQueryString; + } + + public String getQueryString() { + return myQueryString; + } } diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java index 5d5f66b203a..55d3aa42cb5 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java @@ -373,7 +373,6 @@ public class SearchParameterMap implements Serializable { b.append(','); } String valueAsQueryToken = nextValueOr.getValueAsQueryToken(theCtx); -// b.append(ParameterUtil.escapeAndUrlEncode(valueAsQueryToken)); b.append(UrlUtil.escapeUrlParam(valueAsQueryToken)); } }