@openstax/ts-utils 1.32.6 → 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/documentStore/versioned/file-system.js +1 -1
- 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/documentStore/versioned/file-system.js +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
|
@@ -4,7 +4,7 @@ const PAGE_LIMIT = 5;
|
|
|
4
4
|
export const fileSystemVersionedDocumentStore = (initializer) => () => (configProvider) => (_, hashKey, options) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const skipAssert = (_a = options === null || options === void 0 ? void 0 : options.skipAssert) !== null && _a !== void 0 ? _a : false;
|
|
7
|
-
const unversionedDocuments = fileSystemUnversionedDocumentStore(initializer)()(configProvider)({
|
|
7
|
+
const unversionedDocuments = fileSystemUnversionedDocumentStore(initializer)()(configProvider)({}, 'id', { skipAssert });
|
|
8
8
|
return {
|
|
9
9
|
loadAllDocumentsTheBadWay: () => {
|
|
10
10
|
return unversionedDocuments.loadAllDocumentsTheBadWay().then(documents => documents.map(document => {
|
|
@@ -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
|
};
|