fix #1392 add query.additional.analyzed.fields

This commit is contained in:
Shinsuke Sugaya 2018-02-09 07:01:02 +09:00
parent 33e2c6927d
commit eaf3d7e331
3 changed files with 31 additions and 0 deletions

View file

@ -16,6 +16,7 @@
package org.codelibs.fess.helper;
import static org.codelibs.core.stream.StreamUtil.stream;
import static org.codelibs.core.stream.StreamUtil.split;
import java.lang.Character.UnicodeBlock;
import java.util.ArrayList;
@ -282,6 +283,8 @@ public class QueryHelper {
fessConfig.getIndexFieldUrl(), //
fessConfig.getIndexFieldVersion()));
}
split(fessConfig.getQueryAdditionalAnalyzedFields(), ",").of(
stream -> stream.map(s -> s.trim()).filter(StringUtil::isNotBlank).forEach(s -> notAnalyzedFieldSet.remove(s)));
}
public QueryContext build(final SearchRequestType searchRequestType, final String query, final Consumer<QueryContext> context) {

View file

@ -558,6 +558,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. */
String QUERY_ADDITIONAL_SORT_FIELDS = "query.additional.sort.fields";
/** The key of the configuration. e.g. */
String QUERY_ADDITIONAL_ANALYZED_FIELDS = "query.additional.analyzed.fields";
/** The key of the configuration. e.g. */
String QUERY_ADDITIONAL_NOT_ANALYZED_FIELDS = "query.additional.not.analyzed.fields";
@ -3003,6 +3006,21 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
Integer getQueryAdditionalSortFieldsAsInteger();
/**
* Get the value for the key 'query.additional.analyzed.fields'. <br>
* The value is, e.g. <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/
String getQueryAdditionalAnalyzedFields();
/**
* Get the value for the key 'query.additional.analyzed.fields' as {@link Integer}. <br>
* The value is, e.g. <br>
* @return The value of found property. (NotNull: if not found, exception but basically no way)
* @throws NumberFormatException When the property is not integer.
*/
Integer getQueryAdditionalAnalyzedFieldsAsInteger();
/**
* Get the value for the key 'query.additional.not.analyzed.fields'. <br>
* The value is, e.g. <br>
@ -6396,6 +6414,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
return getAsInteger(FessConfig.QUERY_ADDITIONAL_SORT_FIELDS);
}
public String getQueryAdditionalAnalyzedFields() {
return get(FessConfig.QUERY_ADDITIONAL_ANALYZED_FIELDS);
}
public Integer getQueryAdditionalAnalyzedFieldsAsInteger() {
return getAsInteger(FessConfig.QUERY_ADDITIONAL_ANALYZED_FIELDS);
}
public String getQueryAdditionalNotAnalyzedFields() {
return get(FessConfig.QUERY_ADDITIONAL_NOT_ANALYZED_FIELDS);
}
@ -7895,6 +7921,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
defaultMap.put(FessConfig.QUERY_ADDITIONAL_SEARCH_FIELDS, "");
defaultMap.put(FessConfig.QUERY_ADDITIONAL_FACET_FIELDS, "");
defaultMap.put(FessConfig.QUERY_ADDITIONAL_SORT_FIELDS, "");
defaultMap.put(FessConfig.QUERY_ADDITIONAL_ANALYZED_FIELDS, "");
defaultMap.put(FessConfig.QUERY_ADDITIONAL_NOT_ANALYZED_FIELDS, "");
defaultMap.put(FessConfig.QUERY_GSA_RESPONSE_FIELDS, "UE,U,T,RK,S,LANG");
defaultMap.put(FessConfig.QUERY_COLLAPSE_MAX_CONCURRENT_GROUP_RESULTS, "4");

View file

@ -263,6 +263,7 @@ query.additional.highlighted.fields=
query.additional.search.fields=
query.additional.facet.fields=
query.additional.sort.fields=
query.additional.analyzed.fields=
query.additional.not.analyzed.fields=
query.gsa.response.fields=UE,U,T,RK,S,LANG
query.collapse.max.concurrent.group.results=4