mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
Add mongo index (#519)
This commit is contained in:
@@ -26,9 +26,9 @@ export async function connectMongo({
|
||||
bufferCommands: true,
|
||||
maxConnecting: Number(process.env.DB_MAX_LINK || 5),
|
||||
maxPoolSize: Number(process.env.DB_MAX_LINK || 5),
|
||||
minPoolSize: 2,
|
||||
connectTimeoutMS: 20000,
|
||||
waitQueueTimeoutMS: 20000
|
||||
minPoolSize: Number(process.env.DB_MAX_LINK || 10) * 0.5,
|
||||
connectTimeoutMS: 60000,
|
||||
waitQueueTimeoutMS: 60000
|
||||
});
|
||||
|
||||
console.log('mongo connected');
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user