Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
search
Commits
51c9dab2
Commit
51c9dab2
authored
Jul 15, 2021
by
Gradl, Tobias
Browse files
437: Show result highlight in item view (OPENED)
Task-Url:
#437
parent
adc6a035
Changes
2
Hide whitespace changes
Inline
Side-by-side
search-core/src/main/java/eu/dariah/de/search/controller/search/ItemController.java
View file @
51c9dab2
...
...
@@ -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
;
...
...
search-core/src/main/java/eu/dariah/de/search/query/execution/base/BaseQueryService.java
View file @
51c9dab2
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment