Add mongo index (#519)

This commit is contained in:
Archer
2023-11-26 20:17:29 +08:00
committed by GitHub
parent f818260711
commit 933c3fdfd6
7 changed files with 61 additions and 31 deletions

View File

@@ -69,6 +69,7 @@ const DatasetCollectionSchema = new Schema({
try {
DatasetCollectionSchema.index({ datasetId: 1 });
DatasetCollectionSchema.index({ datasetId: 1, parentId: 1 });
DatasetCollectionSchema.index({ updateTime: -1 });
} catch (error) {
console.log(error);

View File

@@ -78,7 +78,8 @@ try {
DatasetDataSchema.index({ datasetId: 1 });
DatasetDataSchema.index({ collectionId: 1 });
// full text index
DatasetDataSchema.index({ fullTextToken: 'text' });
DatasetDataSchema.index({ datasetId: 1, fullTextToken: 'text' });
DatasetDataSchema.index({ fullTextToken: 1 });
} catch (error) {
console.log(error);
}