Merge pull request #219 from vran-dev/fix/fulltext

fix: duplicate search result
This commit is contained in:
vran 2022-05-29 21:42:10 +08:00 committed by GitHub
commit 0fd60c8bc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -238,7 +238,7 @@ public class DocumentService {
GroupPojo group = groupDao.selectById(project.getGroupId());
List<TableColumnDocumentPojo> columns = tableColumnDocumentDao.selectByTableDocumentId(table.getId());
// clear outdated data before save
documentFullTextDao.deleteByTableId(table.getId());
documentFullTextDao.deleteTableFullText(table.getId());
List<DocumentFullTextPojo> fullTextPojoList = columns.stream()
.map(column -> {
String tableName = table.getName();

View File

@ -160,8 +160,9 @@ public class DocumentFullTextDao extends BaseDao<DocumentFullTextPojo> {
return new PageImpl<>(content, pageable, total.longValue());
}
public int deleteByTableId(Integer tableDocumentId) {
return this.delete(DOCUMENT_FULL_TEXT.TABLE_DOCUMENT_ID.eq(tableDocumentId));
public int deleteTableFullText(Integer projectId) {
return this.delete(DOCUMENT_FULL_TEXT.PROJECT_ID.eq(projectId)
.and(DOCUMENT_FULL_TEXT.TABLE_DOCUMENT_ID.isNotNull()));
}
public int deleteByGroupId(Integer groupId) {