final class SearchConfigImpl extends java.lang.Object implements SearchConfig
;; Search configuration [Search] ;; Fields used for regular search. Boost is 1.0 by default. ; searchQueryfields = "[lang]_SearchName^1 [lang]_SubstringName^0.2 [lang]_CategoryNames^0.5 [lang]_PredefValues^0.5 SearchManufacturer^1 [lang]_CustomLocale^0.5 [lang]_Description^0.1 [lang]_Keywords^0.5 [lang]_Text^0.1 UPCEAN^2 Custom^0.5 Alias^2 ManufacturerSKU^2" ;; Fields used in phonetic query for regular search. If necessary, localized to the given language. ;; Remove, if you do not want to use phonetic matching. ; searchPhoneticQueryfields = "[lang]_SuggestName^0.001 [lang]_SuggestCategoryNames^0.001 SuggestManufacturer^0.001" ;; Fields used in search suggestions. ; suggestProductQueryfields = "[lang]_SearchName^1 [lang]_SubstringName^0.2 [lang]_PredefValues^0.5 Alias^2" ;; Fields used in phonetic query for search suggestion ; suggestProductPhoneticQueryfields = "[lang]_SuggestName^0.001" ;; Fields used for categories in search suggestion ; suggestCategoryQueryfields = "[lang]_SearchCategoryNames^1" ;; Fields used in phonetic query for categories in search suggestion ; suggestCategoryPhoneticQueryfields = "[lang]_SuggestCategoryNames^0.001" ;; Fields used for manufacturers in search suggestion ; suggestManufacturerQueryfields = "Manufacturer^1" ;; Fields used in phonetic query for manufacturer suggestion ; suggestManufacturerPhoneticQueryfields = "SuggestManufacturer^0.001" ;; Enable fallback query. At the time of this writing, there is aSimpleFallbackSearchStrategy
, ;; which retries searching without the last search term. See implementations ofFallbackSearchStrategy
; useFallbackQuery = true ;; Default treshold in percent for showing a facet. Facets which match items below ;; this treshold will not be displayed. To disable this feature, set value to 100. ;; @since 6.15.0 ; facetDisplayThreshold = 75 ;; Hiding facets, which have values above this limit to avoid cluttering the user interface. ;; To disable this feature, set to 2147483647. ;; @since 6.15.0 ; facetValueLimit = 500 ;; Single-character suggestions are treated in a special way for performance-reasons. ;; In this case, we only trigger searching against fields, that have a boost of 1.0f ;; or higher. This may require changing the suggestion javascript to start triggering ;; suggestions at the first character. ;; @since 6.15.0
Modifier and Type | Class and Description |
---|---|
static class |
SearchConfigImpl.ConfigurationProperty |
(package private) static class |
SearchConfigImpl.SearchQueryFieldsBuilder |
(package private) static class |
SearchConfigImpl.SuggestQueryFieldsBuilder |
Constructor and Description |
---|
SearchConfigImpl(org.apache.commons.configuration.Configuration config,
Cache<java.lang.String,QueryFields> searchQFieldCache,
Cache<java.lang.String,QueryFields> suggestQueryFields) |
Modifier and Type | Method and Description |
---|---|
int |
getFacetDisplayThreshold()
Treshold in percent for showing a facet.
|
int |
getFacetValueLimit()
To hide facets, which have values above this limit to control the size of the searchresponse.
|
int |
getNumericFiltersTolerance()
A value in percentage which determines the widening of a numeric-range used for filtering.
|
java.util.Collection<QueryField> |
getSearchQueryFields(java.lang.String lang)
List of queryfields for search requests based on the configuration,
if necessary localized to the given language
|
java.util.Collection<QueryField> |
getSuggestQueryFields(java.lang.String lang)
List of queryfields for suggest requests based on the configuration,
if necessary localized to the given language
|
java.util.Collection<QueryField> |
getSuggestQueryFields(java.lang.String language,
float minBoost)
List of queryfields for suggest requests based on the configuration,
if necessary localized to the given language.
|
private static java.util.Collection<QueryField> |
tokenizeFields(java.lang.String q,
java.lang.String lang,
boolean supportsWildcard) |
boolean |
useFallbackQuery()
Enable fallback query.
|
private static final java.lang.String SEARCH_SEARCH_QUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SEARCHPHONETIC_QUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SUGGESTPRODUCT_QUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SUGGESTPRODUCT_PHONETICQUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SUGGESTCATEGORY_QUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SUGGESTCATEGORY_PHONETICQUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SUGGESTMANUFACTURER_QUERYFIELDS_DEFAULT
private static final java.lang.String SEARCH_SUGGESTMANUFACTURER_PHONETICQUERYFIELDS_DEFAULT
private static final boolean SEARCH_USEFALLBACKQUERY_DEFAULT
private static final int SEARCH_FACETDISPLAYTHRESHOLD_DEFAULT
private static final int SEARCH_FACETVALUELIMIT_DEFAULT
private static final int SEARCH_NUMERIC_FILTERS_TOLERANCE_DEFAULT
private final Cache<java.lang.String,QueryFields> searchQueryFields
private final Cache<java.lang.String,QueryFields> suggestQueryFields
private final org.apache.commons.configuration.Configuration config
@Inject public SearchConfigImpl(org.apache.commons.configuration.Configuration config, Cache<java.lang.String,QueryFields> searchQFieldCache, Cache<java.lang.String,QueryFields> suggestQueryFields)
public boolean useFallbackQuery()
SearchConfig
SimpleFallbackSearchStrategy
,
which retries searching without the last search term. See implementations of FallbackSearchStrategy
useFallbackQuery
in interface SearchConfig
public int getFacetDisplayThreshold()
SearchConfig
getFacetDisplayThreshold
in interface SearchConfig
public int getFacetValueLimit()
SearchConfig
getFacetValueLimit
in interface SearchConfig
public int getNumericFiltersTolerance()
SearchConfig
getNumericFiltersTolerance
in interface SearchConfig
public java.util.Collection<QueryField> getSearchQueryFields(java.lang.String lang)
SearchConfig
getSearchQueryFields
in interface SearchConfig
public java.util.Collection<QueryField> getSuggestQueryFields(java.lang.String lang)
SearchConfig
getSuggestQueryFields
in interface SearchConfig
public java.util.Collection<QueryField> getSuggestQueryFields(java.lang.String language, float minBoost)
SearchConfig
getSuggestQueryFields
in interface SearchConfig
private static java.util.Collection<QueryField> tokenizeFields(java.lang.String q, java.lang.String lang, boolean supportsWildcard)