full text tmp code (#3561)

* full text tmp code

* fix: init

* fix: init

* remove tmp code

* remove tmp code

* 4818-alpha
This commit is contained in:
Archer
2025-01-10 18:03:14 +08:00
committed by GitHub
parent fadb3e3ceb
commit 47f7b1a7a3
4 changed files with 48 additions and 46 deletions

View File

@@ -33,12 +33,7 @@ const DatasetDataTextSchema = new Schema({
});
try {
DatasetDataTextSchema.index(
{ teamId: 1, datasetId: 1, fullTextToken: 'text' },
{
partialFilterExpression: { fullTextToken: { $exists: true } }
}
);
DatasetDataTextSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
DatasetDataTextSchema.index({ dataId: 1 }, { unique: true });
} catch (error) {
console.log(error);

View File

@@ -1,4 +1,4 @@
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
import { connectionMongo, getMongoModel } from '../../../common/mongo';
const { Schema, model, models } = connectionMongo;
import { DatasetDataSchemaType } from '@fastgpt/global/core/dataset/type.d';
import {
@@ -70,10 +70,7 @@ const DatasetDataSchema = new Schema({
rebuilding: Boolean,
// Abandon
fullTextToken: {
type: String,
default: ''
},
fullTextToken: String,
initFullText: Boolean
});
@@ -87,7 +84,7 @@ try {
updateTime: -1
});
// FullText tmp full text index
DatasetDataSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
// DatasetDataSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
// Recall vectors after data matching
DatasetDataSchema.index({ teamId: 1, datasetId: 1, collectionId: 1, 'indexes.dataId': 1 });
DatasetDataSchema.index({ updateTime: 1 });