By default, Fredhopper Suggest Search does not require a configuration. Specifying one is only necessary when you want to change the maximum number of suggestion shown, if the server you retrieve the search result numbers from is different than the one you call suggest from or if you want to define timeframes in which suggest should update the number of results at a different speed.
- Exclude suggestions
- Include suggestions
- Location and layout of the configuration
- Change the maximum number of suggestions
- Set the server you want to retrieve the search results numbers from
- Define timeframes with different update intervals
- Sorting suggestions by frequency
- Use a different search profile for Suggest
Exclude suggestions
You have to provide Fredhopper a file called blacklist.csv using double tab as separator. The file needs to have the following format:
| Searchterm to be excluded | Locale | Scope |
|---|---|---|
| sony | en_US | catalog01_01 |
| mouse | en_US |
Include suggestions
You have to provide Fredhopper a file called whitelist.csv using double tab as separator. The file needs to have the following format:
| Searchterm to be included | Locale | Scope |
|---|---|---|
| sony | en_US | catalog01_01 |
| mouse | en_US |
Location and layout of the configuration
The configuration is stored in a file called com.fredhopper.suggest.config@0. Depending on the version of Fredhopper Suggest and the deployment model this file must be placed into a different directory.
| Suggest VersionDeployment Model | Deployment Package | FAS Module |
|---|---|---|
| 1.x | not supported | <FAS>/data/suggest/config |
| 2.x | <instance>/config | <FAS>/config |
A typical configuration will look similar to this example:
<com.fredhopper.fss.qserver.SuggestConfig>
<maxNrOfSuggestions-1keywords>5</maxNrOfSuggestions-1keywords>
<queryUrl>http://localhost:8180</queryUrl>
<update-timeframe-0>
<starttime>0 0/5 * * * ?</starttime>
<durationInMillis>180000</durationInMillis>
<intervalInMillis>500</intervalInMillis>
</update-timeframe-0>
<standardIntervalInMillis>15000</standardIntervalInMillis>
</com.fredhopper.fss.qserver.SuggestConfig>
Change the maximum number of suggestions
For each type of suggestions (keyword, categories, product, etc.), Fredhopper will generate one index file. By default, the number of maximum items shown is set to 5 per index file. If you want to change this number, you will have to add a new line to the configuration file, looking as follows:
<maxNrOfSuggestions-NAME_OF_INDEX_FILE>NUMBER_OF_ITEMS</maxNrOfSuggestions-NAME_OF_INDEX_FILE>
NAME_OF_INDEX_FILE stands for the name of the index file you want to adapt. If you for example want to change the maximum number of suggestions for the index 1keywords.idx to 8 suggestions, you would add the following to the configuration:
<maxNrOfSuggestions-1keywords>8</maxNrOfSuggestions-1keywords>
You can of course add more than one entry if you have more than one index:
<maxNrOfSuggestions-1keywords>8</maxNrOfSuggestions-1keywords> <maxNrOfSuggestions-2categories>3</maxNrOfSuggestions-2categories>
Set the server you want to retrieve the search results numbers from
If you want to use a different server than the one you run Suggest on to query for search result numbers, you can specify it by adding the following line to the configuration:
<queryUrl>HOST:PORT</queryUrl>
If you are, for example, running Fredhopper Suggest Search on port 8180 and want to use a second instance on 9180 for querying the search results, you would specify:
<queryUrl>localhost:9180</queryUrl>
| You can only specify one server for all your Suggest indices. |
Define timeframes with different update intervals
By default, Fredhopper Suggest Search will update the search result number for one entry every 15 seconds. Through a configuration, you can specify certain timeframes throughout the day where this interval can be adapted. The basic layout for such a specification looks as follows:
<update-timeframe-0> <starttime>CRON_EXPRESSION</starttime> <durationInMillis>LENGTH_OF_THE_TIMEFRAME_IN_MILLISECONDS</durationInMillis> <intervalInMillis>QUERY_INTERVAL_IN_MILLISECONDS</intervalInMillis> </update-timeframe-0>
The start time for each timeframe is specified by a standard CRON expression, documentation on how to create one can be found here.
The duration of the timeframe ("durationInMillis") is given in milliseconds, so if you want to your timeframe to extend to half an hour you would specify 1800000 in that field. The "intervalInMillis" setting defines how many milliseconds suggest will wait before starting another update query. It is possible to define more than one such timeframe by increasing the counter of the "update-timeframe" element.
|
Maximum Duration The time frame can have a length of at most 7200000ms (2h). |
In the next example two timeframes are configured, one starting at 6 in the morning and one at 8 at night every day, both running for half an hour with queries send every half second.
<update-timeframe-0> <starttime>0 0 6 * * ?</starttime> <durationInMillis>1800000</durationInMillis> <intervalInMillis>500</intervalInMillis> </update-timeframe-0> <update-timeframe-1> <starttime>0 0 20 * * ?</starttime> <durationInMillis>1800000</durationInMillis> <intervalInMillis>500</intervalInMillis> </update-timeframe-1>
Sorting suggestions by frequency
By default the responses of a suggest query are returned sorted alphabetically. Starting with Fredhopper Suggest 2.x this can be changed to return the suggestions sorted by the the rank of the entry in the index file (which can be mapped to e.g. frequency of a keyword) using a configuration option:
<sortSuggestionsAlphabetically>false</sortSuggestionsAlphabetically>
Use a different search profile for Suggest
by default suggest will query FAS using the default search profile. Starting with Fredhopper Suggest 2.x a different profile can be selected to fine-tune the search results for Suggest.
<searchProfile>suggest</searchProfile>
Please note, that due to the functionality of suggest to distinguish between redirect/no-redirect functionality (i.e. there is an option to allow e.g. content suggestions of "contact us", "legal" or "stores near your location" to be returned regardless of the number of hits a search on that term would yield).
For this, the suggest profile name will be appended with "_noredirect" in cases of regular search queries and will be left on the value defined in the config for redirected, i.e. hardcoded queries.
Configure "article number Suggest"
| "Article number" suggestions have been removed in Fredhopper Suggest 2.x. The instructions here only apply for Fredhopper Suggest 1.x. |
Suggest will return a 'hint' on how to format article numbers if the query consists only of digits and dash ('-') characters, and a format pattern for article numbers is configured.
The default pattern is '_____-_' (six digits, one dash, followed by two digits). This pattern can be changed using the <articleNumberSuggestFormat> configuration option:
<articleNumberSuggestFormat>__-__-__</articleNumberSuggestFormat>
This would configure the article number format to "two digits, one dash, two digits, one dash, followed by two digits.'
The article number suggestions can be disabled by setting the format to '_':
<articleNumberSuggestFormat>_</articleNumberSuggestFormat>
Comments
0 comments
Please sign in to leave a comment.