RED-809: Fixed indexing pages multiple times

This commit is contained in:
Dominique Eifländer 2021-07-07 13:55:45 +02:00
parent d0a1a4a8e7
commit 7df41f0d05
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
package com.iqser.red.service.search.v1.server.model;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
@ -18,6 +18,6 @@ public class IndexSection implements Serializable {
private int sectionNumber;
private String text;
private List<Integer> pages;
private Set<Integer> pages;
private String headline;
}

View File

@ -76,7 +76,7 @@ public class DocumentIndexService {
return IndexSection.builder()
.sectionNumber(sectionText.getSectionNumber())
.text(sectionText.getText())
.pages(sectionText.getSectionAreas().stream().map(SectionArea::getPage).collect(Collectors.toList()))
.pages(sectionText.getSectionAreas().stream().map(SectionArea::getPage).collect(Collectors.toSet()))
.headline(sectionText.getHeadline())
.build();
}