Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net committed Sep 24, 2024
1 parent 1a0a6af commit 3b9ba93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
9 changes: 6 additions & 3 deletions packages/backend/src/core/AdvancedSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -919,11 +919,14 @@ export class AdvancedSearchService {
}

const user = await this.cacheService.findUserById(Note._source.userId);
if (!user.isIndexable) { //検索許可されていないが、
if (!this.opensearch || !meUserId) {
if (!user) return null;
if (user.isIndexable === false) { //検索許可されていないが、
if (meUserId) {
return null;
}
if (!this.opensearch) {
return null;
}

const Option = {
index: this.reactionIndex,
body: {
Expand Down
20 changes: 12 additions & 8 deletions packages/backend/src/server/api/endpoints/admin/full-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
private advancedSearchService: AdvancedSearchService,
) {
super(meta, paramDef, async (ps, me) => {
if (ps.index === 'notes') {
this.advancedSearchService.fullIndexNote();
} else if (ps.index === 'reaction') {
this.advancedSearchService.fullIndexReaction();
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if (ps.index === 'pollVote') {
this.advancedSearchService.fullIndexPollVote();
switch (ps.index) {
case 'notes':
this.advancedSearchService.fullIndexNote();
break;
case 'reaction':
this.advancedSearchService.fullIndexReaction();
break;
case 'pollVote':
this.advancedSearchService.fullIndexPollVote();
break;
}
});
},
);
}
}

0 comments on commit 3b9ba93

Please sign in to comment.