@openstax/ts-utils 1.32.7 → 1.33.0
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.
- package/dist/cjs/services/searchProvider/openSearch.d.ts +1 -0
- package/dist/cjs/services/searchProvider/openSearch.js +13 -1
- package/dist/cjs/tsconfig.without-specs.cjs.tsbuildinfo +1 -1
- package/dist/esm/services/searchProvider/openSearch.d.ts +1 -0
- package/dist/esm/services/searchProvider/openSearch.js +13 -1
- package/dist/esm/tsconfig.without-specs.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -133,6 +133,18 @@ export const openSearchService = (initializer = {}) => (configProvider) => {
|
|
|
133
133
|
const totalPages = Math.ceil(totalItems / pageSize) || 1;
|
|
134
134
|
return { items, pageSize, currentPage, totalItems, totalPages };
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
const updateMappings = async () => {
|
|
137
|
+
const { indices } = await client();
|
|
138
|
+
await indices.putMapping({
|
|
139
|
+
index: indexConfig.name,
|
|
140
|
+
body: {
|
|
141
|
+
properties: indexConfig.mappings
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
requestTimeout: 10000,
|
|
145
|
+
maxRetries: 1,
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
return { ensureIndexCreated, deleteIndexIfExists, index, bulkIndex, search, updateMappings };
|
|
137
149
|
};
|
|
138
150
|
};
|