From b00716153500e6c852e478052d054457fbd4db70 Mon Sep 17 00:00:00 2001 From: hilary egesa Date: Wed, 28 Aug 2024 14:18:01 +0300 Subject: [PATCH] make updating fts search tables optional - This updates can take a long time during initial sync - The implementing application can directly query the original tables with the that have columns that are indexed at a similar or better speeds --- README.md | 5 +++-- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../src/main/java/org/smartregister/AllConstants.java | 1 + .../java/org/smartregister/sync/ClientProcessorForJava.java | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b1f2e8da5..34bb0a109 100644 --- a/README.md +++ b/README.md @@ -307,11 +307,12 @@ By placing a file named `app.properties` in your implementation assets folder (S ### Configurable Settings | Configuration | Type | Default | Description | -| ---------------------------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| ---------------------------------------- | ------- | ------- |-----------------------------------------------------------------------------------------------------------------------------------------------------| | `system.toaster.centered` | Boolean | false | Position toaster(s) at the center of the view(s) | | `disable.location.picker.view` | Boolean | false | Disables LocationPicker View | | `location.picker.tag.shown` | Boolean | false | Hides/Shows the location tag in the location picker tree view | | `encrypt.shared.preferences` | Boolean | false | Enable/disables encrypting SharedPreferences | | `allow.offline.login.with.invalid.token` | Boolean | false | Allow offline login when token is no longer valid after a successful login when online and user is forcefully logged out | | `enable.search.button` | Boolean | false | Enable/Disable search to be triggered only after clicking the search icon in `org.smartregister.view.fragment.BaseRegisterFragment` or its subclass | -| `feature.profile.images.disabled` | Boolean | false | Disable profile image capturing and rendering | \ No newline at end of file +| `feature.profile.images.disabled` | Boolean | false | Disable profile image capturing and rendering | +| `"disable.fts.search` | Boolean | false | Disable fts search which can slow down sync process | \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c869817a4..e27e4ee3a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=6.1.4-SNAPSHOT +VERSION_NAME=6.1.5-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Core Application diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7546b80ac..bc537e0d2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -7,4 +7,4 @@ org.gradle.daemon=true org.gradle.parallel=true zipStoreBase=GRADLE_USER_HOME org.gradle.configureondemand=true -org.gradle.jvmargs=-Xmx2048m +org.gradle.jvmargs=-Xmx2048m --add-opens java.base/java.io=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED diff --git a/opensrp-core/src/main/java/org/smartregister/AllConstants.java b/opensrp-core/src/main/java/org/smartregister/AllConstants.java index 4d7c0a6ce..8f1391868 100644 --- a/opensrp-core/src/main/java/org/smartregister/AllConstants.java +++ b/opensrp-core/src/main/java/org/smartregister/AllConstants.java @@ -352,6 +352,7 @@ public static class PROPERTY { public static final String IGNORE_LOCATION_DELETION = "ignore.location.deletion"; public static final String ENABLE_SEARCH_BUTTON = "enable.search.button"; public static final String DISABLE_PROFILE_IMAGES_FEATURE = "feature.profile.images.disabled"; + public static final String DISABLE_FTS_SEARCH_DISABLE="disable.fts.search"; } public static class HTTP_REQUEST_HEADERS { diff --git a/opensrp-core/src/main/java/org/smartregister/sync/ClientProcessorForJava.java b/opensrp-core/src/main/java/org/smartregister/sync/ClientProcessorForJava.java index 79e01dd63..8848e6435 100644 --- a/opensrp-core/src/main/java/org/smartregister/sync/ClientProcessorForJava.java +++ b/opensrp-core/src/main/java/org/smartregister/sync/ClientProcessorForJava.java @@ -364,7 +364,8 @@ public Boolean processCaseModel(Event event, Client client, List creates String entityId = contentValues.getAsString(CommonRepository.BASE_ENTITY_ID_COLUMN); String clientType = client.getClientType() != null ? client.getClientType() : (client.getRelationships() != null ? AllConstants.ECClientType.CHILD : null); - updateFTSsearch(tableName, clientType, entityId, contentValues); + if (!CoreLibrary.getInstance().context().getAppProperties().isTrue(AllConstants.PROPERTY.DISABLE_PROFILE_IMAGES_FEATURE)) + updateFTSsearch(tableName, clientType, entityId, contentValues); Long timestamp = getEventDate(event.getEventDate()); addContentValuesToDetailsTable(contentValues, timestamp); updateClientDetailsTable(event, client);