diff --git a/src/main/java/org/codelibs/fess/helper/ViewHelper.java b/src/main/java/org/codelibs/fess/helper/ViewHelper.java index 408085701..687da01e9 100644 --- a/src/main/java/org/codelibs/fess/helper/ViewHelper.java +++ b/src/main/java/org/codelibs/fess/helper/ViewHelper.java @@ -112,34 +112,37 @@ public class ViewHelper { public String originalHighlightTagPost = ""; - public String highlightTagPre = ""; + protected String highlightTagPre; - public String highlightTagPost = ""; + protected String highlightTagPost; protected boolean useSession = true; - private final Map pageCacheMap = new ConcurrentHashMap<>(); + protected final Map pageCacheMap = new ConcurrentHashMap<>(); - private final Map initFacetParamMap = new HashMap<>(); + protected final Map initFacetParamMap = new HashMap<>(); - private final Map initGeoParamMap = new HashMap<>(); + protected final Map initGeoParamMap = new HashMap<>(); - private final List facetQueryViewList = new ArrayList<>(); + protected final List facetQueryViewList = new ArrayList<>(); public String cacheTemplateName = "cache"; - private String escapedHighlightPre = null; + protected String escapedHighlightPre = null; - private String escapedHighlightPost = null; + protected String escapedHighlightPost = null; protected ActionHook actionHook = new ActionHook(); - private final Set inlineMimeTypeSet = new HashSet<>(); + protected final Set inlineMimeTypeSet = new HashSet<>(); @PostConstruct public void init() { + final FessConfig fessConfig = ComponentUtil.getFessConfig(); escapedHighlightPre = LaFunctions.h(originalHighlightTagPre); escapedHighlightPost = LaFunctions.h(originalHighlightTagPost); + highlightTagPre = fessConfig.getQueryHighlightTagPre(); + highlightTagPost = fessConfig.getQueryHighlightTagPost(); } public String getContentTitle(final Map document) { diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java index b27d6f20f..7150c3ab5 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java @@ -572,6 +572,12 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction /** The key of the configuration. e.g. fvh */ String QUERY_HIGHLIGHT_TYPE = "query.highlight.type"; + /** The key of the configuration. e.g. <strong> */ + String QUERY_HIGHLIGHT_TAG_PRE = "query.highlight.tag.pre"; + + /** The key of the configuration. e.g. </strong> */ + String QUERY_HIGHLIGHT_TAG_POST = "query.highlight.tag.post"; + /** The key of the configuration. e.g. 100000 */ String QUERY_MAX_SEARCH_RESULT_OFFSET = "query.max.search.result.offset"; @@ -2999,6 +3005,20 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction */ String getQueryHighlightType(); + /** + * Get the value for the key 'query.highlight.tag.pre'.
+ * The value is, e.g. <strong>
+ * @return The value of found property. (NotNull: if not found, exception but basically no way) + */ + String getQueryHighlightTagPre(); + + /** + * Get the value for the key 'query.highlight.tag.post'.
+ * The value is, e.g. </strong>
+ * @return The value of found property. (NotNull: if not found, exception but basically no way) + */ + String getQueryHighlightTagPost(); + /** * Get the value for the key 'query.max.search.result.offset'.
* The value is, e.g. 100000
@@ -6517,6 +6537,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction return get(FessConfig.QUERY_HIGHLIGHT_TYPE); } + public String getQueryHighlightTagPre() { + return get(FessConfig.QUERY_HIGHLIGHT_TAG_PRE); + } + + public String getQueryHighlightTagPost() { + return get(FessConfig.QUERY_HIGHLIGHT_TAG_POST); + } + public String getQueryMaxSearchResultOffset() { return get(FessConfig.QUERY_MAX_SEARCH_RESULT_OFFSET); } @@ -8102,6 +8130,8 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction defaultMap.put(FessConfig.QUERY_HIGHLIGHT_FRAGMENT_SIZE, "40"); defaultMap.put(FessConfig.QUERY_HIGHLIGHT_NUMBER_OF_FRAGMENTS, "3"); defaultMap.put(FessConfig.QUERY_HIGHLIGHT_TYPE, "fvh"); + defaultMap.put(FessConfig.QUERY_HIGHLIGHT_TAG_PRE, ""); + defaultMap.put(FessConfig.QUERY_HIGHLIGHT_TAG_POST, ""); defaultMap.put(FessConfig.QUERY_MAX_SEARCH_RESULT_OFFSET, "100000"); defaultMap.put(FessConfig.QUERY_ADDITIONAL_RESPONSE_FIELDS, ""); defaultMap.put(FessConfig.QUERY_ADDITIONAL_API_RESPONSE_FIELDS, ""); diff --git a/src/main/resources/fess_config.properties b/src/main/resources/fess_config.properties index 9340a9e03..af93f6252 100644 --- a/src/main/resources/fess_config.properties +++ b/src/main/resources/fess_config.properties @@ -287,6 +287,8 @@ query.replace.term.with.prefix.query=true query.highlight.fragment.size=40 query.highlight.number.of.fragments=3 query.highlight.type=fvh +query.highlight.tag.pre= +query.highlight.tag.post= query.max.search.result.offset=100000 query.additional.response.fields= query.additional.api.response.fields=