feat: tmp upgrade code (#3559)

* feat: tmp upgrade code

* fulltext search test

* update action
This commit is contained in:
Archer
2025-01-10 14:41:29 +08:00
committed by GitHub
parent 1c0b323b1b
commit fadb3e3ceb
9 changed files with 24 additions and 24 deletions

View File

@@ -29,14 +29,16 @@ const DatasetDataTextSchema = new Schema({
ref: DatasetDataCollectionName,
required: true
},
fullTextToken: {
type: String,
required: true
}
fullTextToken: String
});
try {
DatasetDataTextSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
DatasetDataTextSchema.index(
{ teamId: 1, datasetId: 1, fullTextToken: 'text' },
{
partialFilterExpression: { fullTextToken: { $exists: true } }
}
);
DatasetDataTextSchema.index({ dataId: 1 }, { unique: true });
} catch (error) {
console.log(error);

View File

@@ -86,8 +86,8 @@ try {
chunkIndex: 1,
updateTime: -1
});
// full text index
// DatasetDataSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
// FullText tmp full text index
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 });

View File

@@ -636,6 +636,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
forbidCollectionIdList,
filterCollectionIdList
}),
// FullText tmp
fullTextRecall2({
query,
limit: fullTextLimit,