mirror of
https://github.com/vran-dev/databasir.git
synced 2025-09-23 04:19:31 +08:00
fix: duplicate search result
This commit is contained in:
@@ -238,7 +238,7 @@ public class DocumentService {
|
|||||||
GroupPojo group = groupDao.selectById(project.getGroupId());
|
GroupPojo group = groupDao.selectById(project.getGroupId());
|
||||||
List<TableColumnDocumentPojo> columns = tableColumnDocumentDao.selectByTableDocumentId(table.getId());
|
List<TableColumnDocumentPojo> columns = tableColumnDocumentDao.selectByTableDocumentId(table.getId());
|
||||||
// clear outdated data before save
|
// clear outdated data before save
|
||||||
documentFullTextDao.deleteByTableId(table.getId());
|
documentFullTextDao.deleteTableFullText(table.getId());
|
||||||
List<DocumentFullTextPojo> fullTextPojoList = columns.stream()
|
List<DocumentFullTextPojo> fullTextPojoList = columns.stream()
|
||||||
.map(column -> {
|
.map(column -> {
|
||||||
String tableName = table.getName();
|
String tableName = table.getName();
|
||||||
|
@@ -160,8 +160,9 @@ public class DocumentFullTextDao extends BaseDao<DocumentFullTextPojo> {
|
|||||||
return new PageImpl<>(content, pageable, total.longValue());
|
return new PageImpl<>(content, pageable, total.longValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteByTableId(Integer tableDocumentId) {
|
public int deleteTableFullText(Integer projectId) {
|
||||||
return this.delete(DOCUMENT_FULL_TEXT.TABLE_DOCUMENT_ID.eq(tableDocumentId));
|
return this.delete(DOCUMENT_FULL_TEXT.PROJECT_ID.eq(projectId)
|
||||||
|
.and(DOCUMENT_FULL_TEXT.TABLE_DOCUMENT_ID.isNotNull()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int deleteByGroupId(Integer groupId) {
|
public int deleteByGroupId(Integer groupId) {
|
||||||
|
Reference in New Issue
Block a user