use of com.enonic.xp.query.highlight.HighlightQuerySettings in project xp by enonic.
the class QueryHighlightParams method getHighlightQuery.
HighlightQuery getHighlightQuery(final Map<String, Object> highlightMap) {
if (highlightMap == null) {
return HighlightQuery.empty();
}
final HighlightQuerySettings settings = fillQuerySettings(HighlightQuerySettings.create(), highlightMap).build();
final HighlightQuery.Builder highlightQuery = HighlightQuery.create().settings(settings);
final Map<String, Object> propertiesMap = (Map<String, Object>) highlightMap.get("properties");
if (propertiesMap == null) {
return HighlightQuery.empty();
}
propertiesMap.forEach((name, propertyMap) -> {
final HighlightQueryProperty highlightQueryProperty = highlightPropertyFromParams(name, (Map<String, Object>) propertyMap);
highlightQuery.property(highlightQueryProperty);
});
return highlightQuery.build();
}
use of com.enonic.xp.query.highlight.HighlightQuerySettings in project xp by enonic.
the class QueryHighlightParams method getHighlightQuery.
HighlightQuery getHighlightQuery(final Map<String, Object> highlightMap) {
if (highlightMap == null) {
return HighlightQuery.empty();
}
final HighlightQuerySettings settings = fillQuerySettings(HighlightQuerySettings.create(), highlightMap).build();
final HighlightQuery.Builder highlightQuery = HighlightQuery.create().settings(settings);
final Map<String, Object> propertiesMap = (Map<String, Object>) highlightMap.get("properties");
if (propertiesMap == null) {
return HighlightQuery.empty();
}
propertiesMap.forEach((name, propertyMap) -> {
final HighlightQueryProperty highlightQueryProperty = highlightPropertyFromParams(name, (Map<String, Object>) propertyMap);
highlightQuery.property(highlightQueryProperty);
});
return highlightQuery.build();
}
Aggregations