kuzzle 2.19.7 → 2.19.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,12 +85,6 @@ class NativeController extends BaseController {
85
85
  throw assertionError.get("invalid_type", "body.query", "object");
86
86
  }
87
87
 
88
- try {
89
- global.kuzzle.koncorde.validate(koncordeFilters);
90
- } catch (error) {
91
- throw assertionError.getFrom(error, "koncorde_dsl_error", error.message);
92
- }
93
-
94
88
  try {
95
89
  return await this.ask("core:storage:public:translate", koncordeFilters);
96
90
  } catch (error) {
@@ -290,6 +290,10 @@ const defaultConfig = {
290
290
  },
291
291
  },
292
292
  },
293
+ defaultSettings: {
294
+ number_of_replicas: 1,
295
+ number_of_shards: 1,
296
+ },
293
297
  internalIndex: {
294
298
  name: "kuzzle",
295
299
  collections: {
@@ -1395,6 +1395,14 @@ class ElasticSearch extends Service {
1395
1395
  ),
1396
1396
  };
1397
1397
 
1398
+ esRequest.body.settings.number_of_replicas =
1399
+ esRequest.body.settings.number_of_replicas ||
1400
+ this.config.defaultSettings.number_of_replicas;
1401
+
1402
+ esRequest.body.settings.number_of_shards =
1403
+ esRequest.body.settings.number_of_shards ||
1404
+ this.config.defaultSettings.number_of_shards;
1405
+
1398
1406
  try {
1399
1407
  await this._client.indices.create(esRequest);
1400
1408
  } catch (error) {
@@ -3141,8 +3149,8 @@ class ElasticSearch extends Service {
3141
3149
  [this._getAlias(index, HIDDEN_COLLECTION)]: {},
3142
3150
  },
3143
3151
  settings: {
3144
- number_of_replicas: 1,
3145
- number_of_shards: 1,
3152
+ number_of_replicas: this.config.defaultSettings.number_of_replicas,
3153
+ number_of_shards: this.config.defaultSettings.number_of_shards,
3146
3154
  },
3147
3155
  },
3148
3156
  index: await this._getAvailableIndice(index, HIDDEN_COLLECTION),
@@ -84,7 +84,6 @@ const KONCORDE_CLAUSES_TO_ES = {
84
84
  ...content,
85
85
  },
86
86
  }),
87
- regexp: undefined,
88
87
  };
89
88
 
90
89
  const KONCORDE_OPERATORS_TO_ES = {
@@ -145,7 +144,9 @@ class QueryTranslator {
145
144
  const converter = KONCORDE_CLAUSES_TO_ES[clause];
146
145
 
147
146
  if (converter === undefined) {
148
- throw new KeywordError("clause", clause);
147
+ return {
148
+ [clause]: content,
149
+ };
149
150
  }
150
151
 
151
152
  return converter(content);
@@ -95,6 +95,24 @@ export declare type StorageEngineElasticsearch = {
95
95
  };
96
96
  };
97
97
  };
98
+ /**
99
+ * Global settings to apply by default (if not overridden by user request ones)
100
+ * @default
101
+ * {
102
+ * number_of_shards: 1,
103
+ * number_of_replicas: 1
104
+ * }
105
+ */
106
+ defaultSettings: {
107
+ /**
108
+ * @default 1
109
+ */
110
+ number_of_shards: number;
111
+ /**
112
+ * @default 1
113
+ */
114
+ number_of_replicas: number;
115
+ };
98
116
  internalIndex: {
99
117
  /**
100
118
  * @default "kuzzle"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kuzzle",
3
3
  "author": "The Kuzzle Team <support@kuzzle.io>",
4
- "version": "2.19.7",
4
+ "version": "2.19.8",
5
5
  "description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
6
6
  "bin": "bin/start-kuzzle-server",
7
7
  "scripts": {