fix #909 add query.highlight.type
This commit is contained in:
parent
9a99133f2d
commit
c171f5d5b0
3 changed files with 18 additions and 2 deletions
|
@ -873,8 +873,9 @@ public class FessEsClient implements Client {
|
|||
|
||||
// highlighting
|
||||
final HighlightBuilder highlightBuilder = new HighlightBuilder();
|
||||
queryHelper.highlightedFields(stream -> stream.forEach(hf -> highlightBuilder.field(hf,
|
||||
fessConfig.getQueryHighlightFragmentSizeAsInteger(), fessConfig.getQueryHighlightNumberOfFragmentsAsInteger())));
|
||||
queryHelper.highlightedFields(stream -> stream.forEach(hf -> highlightBuilder.field(new HighlightBuilder.Field(hf)
|
||||
.highlighterType(fessConfig.getQueryHighlightType()).fragmentSize(fessConfig.getQueryHighlightFragmentSizeAsInteger())
|
||||
.numOfFragments(fessConfig.getQueryHighlightNumberOfFragmentsAsInteger()))));
|
||||
searchRequestBuilder.highlighter(highlightBuilder);
|
||||
|
||||
// facets
|
||||
|
|
|
@ -450,6 +450,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
/** The key of the configuration. e.g. 5 */
|
||||
String QUERY_HIGHLIGHT_NUMBER_OF_FRAGMENTS = "query.highlight.number.of.fragments";
|
||||
|
||||
/** The key of the configuration. e.g. fvh */
|
||||
String QUERY_HIGHLIGHT_TYPE = "query.highlight.type";
|
||||
|
||||
/** The key of the configuration. e.g. 100000 */
|
||||
String QUERY_MAX_SEARCH_RESULT_OFFSET = "query.max.search.result.offset";
|
||||
|
||||
|
@ -2426,6 +2429,13 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
*/
|
||||
Integer getQueryHighlightNumberOfFragmentsAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'query.highlight.type'. <br>
|
||||
* The value is, e.g. fvh <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getQueryHighlightType();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'query.max.search.result.offset'. <br>
|
||||
* The value is, e.g. 100000 <br>
|
||||
|
@ -5352,6 +5362,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
return getAsInteger(FessConfig.QUERY_HIGHLIGHT_NUMBER_OF_FRAGMENTS);
|
||||
}
|
||||
|
||||
public String getQueryHighlightType() {
|
||||
return get(FessConfig.QUERY_HIGHLIGHT_TYPE);
|
||||
}
|
||||
|
||||
public String getQueryMaxSearchResultOffset() {
|
||||
return get(FessConfig.QUERY_MAX_SEARCH_RESULT_OFFSET);
|
||||
}
|
||||
|
|
|
@ -210,6 +210,7 @@ query.browser.lang.parameter.name=browser_lang
|
|||
query.replace.term.with.prefix.query=true
|
||||
query.highlight.fragment.size=50
|
||||
query.highlight.number.of.fragments=5
|
||||
query.highlight.type=fvh
|
||||
query.max.search.result.offset=100000
|
||||
query.additional.response.fields=
|
||||
query.additional.api.response.fields=
|
||||
|
|
Loading…
Add table
Reference in a new issue