Commit 51c9dab2 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

437: Show result highlight in item view (OPENED)

Task-Url: #437
parent adc6a035
......@@ -17,8 +17,6 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -44,7 +42,6 @@ import eu.dariah.de.search.model.ExtendedDatamodelContainer;
import eu.dariah.de.search.query.Query;
import eu.dariah.de.search.query.execution.ItemService;
import eu.dariah.de.search.query.execution.QueryExecutionServiceImpl;
import eu.dariah.de.search.query.results.FieldHighlight;
import eu.dariah.de.search.query.results.QueryResult;
import eu.dariah.de.search.query.results.ResultElement;
import eu.dariah.de.search.service.CollectionService;
......
......@@ -48,11 +48,12 @@ public abstract class BaseQueryService extends BaseResultService {
sourceHighlightBuilder = new HighlightBuilder();
sourceHighlightBuilder.numOfFragments(3);
sourceHighlightBuilder.encoder("html");
sourceHighlightBuilder.fragmentSize(150);
sourceHighlightBuilder.requireFieldMatch(false);
sourceHighlightBuilder.order(Order.SCORE);
sourceHighlightBuilder.field("_all").preTags("<span class=\"result-highlight\">").postTags("</span>");
sourceHighlightBuilder.field(Constants.ELEMENT_KEY_ALL).numOfFragments(20);
sourceHighlightBuilder.field(Constants.ELEMENT_KEY_ALL).numOfFragments(20);
}
public static QueryBuilder getCollectionIdQueryBuilder(List<String> collectionIds) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment