File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
core/src/main/java/io/snabble/sdk Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1111,7 +1111,7 @@ private void exec(String sql) {
11111111 }
11121112 }
11131113
1114- private String bindArgs (String sql , String [] args ) {
1114+ public static String bindArgs (String sql , String [] args ) {
11151115 if (args == null ) {
11161116 return sql ;
11171117 }
Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ public class Project {
9999 .build ();
100100
101101 boolean generateSearchIndex = snabble .getConfig ().generateSearchIndex ;
102+ // Generate FTS if the shopping list is used and there is no shopping list database
103+ if (snabble .getConfig ().isUsingShoppingList && getShoppingListDbUrl () == null ) {
104+ generateSearchIndex = true ;
105+ }
102106
103107 productDatabase = new ProductDatabase (this , id + ".sqlite3" , generateSearchIndex );
104108 shoppingCartStorage = new ShoppingCartStorage (this );
Original file line number Diff line number Diff line change @@ -724,6 +724,15 @@ public static class Config {
724724 */
725725 public boolean generateSearchIndex ;
726726
727+ /**
728+ * If set to true, the SDK downloads the shopping list meta data are present or creates an
729+ * full text index for the product data.
730+ * <p>
731+ * Note that this increases setup time of the ProductDatabase when there are no shopping
732+ * list meta data, and it may not be immediately available offline.
733+ */
734+ public boolean isUsingShoppingList ;
735+
727736 /**
728737 * The time that the database is allowed to be out of date. After the specified time in
729738 * milliseconds the database only uses online requests for asynchronous requests.
You can’t perform that action at this time.
0 commit comments