feat: 搜索引擎重建索引时排除归档内容

This commit is contained in:
2025-12-05 07:44:19 +00:00
parent 6a4323df77
commit c16818a6bb

View File

@ -157,7 +157,16 @@ export default defineHook(async ({ init, filter, action, schedule }, { services,
const queryFields = buildQueryFields(fields); const queryFields = buildQueryFields(fields);
const itemService = new ItemsService(cfg.collection_name, { schema }); const itemService = new ItemsService(cfg.collection_name, { schema });
const items = await itemService.readByQuery({ fields: queryFields, limit: -1 }); const items = await itemService.readByQuery({
fields: queryFields,
filter: {
_or: [
{ status: { _null: true }},
{ status: { _neq: 'archived'}},
]
},
limit: -1
});
// 为每种语言重建索引 // 为每种语言重建索引
for (const lang of availableLanguages) { for (const lang of availableLanguages) {