Plugin: Query language - wildcard (truncation) support

Purpose

Use this plugin when you need to support wildcards (e.g. pic*) in your search.

This plugin can be used to add limited wildcard (truncation) support to user queries. It allows you to use the asterisk operator on the right-hand side (only) of words in a query. Each word that is followed by an asterisk will be internally expanded into a set of words that start with indicated word.

Funnelback has a deprecated truncation operator (*), which provided support for wildcards in queries when the search was configured to run in term at a time mode (when you have -daat=0 or -service_volume=low set as a query processor option). This plugin should be used instead of the deprecated query processing mode as many newer features within Funnelback do not work with the deprecated term at a time mode.

When to use this plugin

Use this plugin when you need to provide wildcard support in queries, or if you need to support search-based auto-completion.

Once enabled, queries such as Dan* Smith or aus* directory pol* are accepted.

This provides an efficient way of supporting wildcards - however the expanded query won’t return all the matching results (compared to if a full expansion of the wildcard was performed). There is a fine balancing act between performance and completeness of the search result set and the goal of a web search engine such as Funnelback has always been to return a set of relevant results. This set isn’t necessarily complete as shortcuts are taken to determine relevant results quickly.

Details

This plugin uses the auto-completion service to expand any words that are followed by an asterisk operator in a query, with the maximum number of query terms to use for expansion value limiting the size of the expansion for each term.

When Prefix mode is enabled, wildcard characters in the query are ignored and expansion is applied at the end of the entire query (e.g. abc def behaves as abc def*). This supports search-based auto-completion where the partial query is sent without a trailing *.

The expanded queries can be seen by viewing the JSON or XML output and looking at the query/queryAsProcessed/queryRaw/querySystemRaw/queryCleaned values from the response packet. Expansions are injected into the querySystemRaw element.

Use with structured auto-completion

This plugin is designed to be used with the word-based organic auto-completion and use with CSV based auto-completion (structured) or the auto-completion plugin is not recommended. If you need to supply structured auto-completion or us the auto-completion plugin for your search you should create a dedicated results page for this auto-completion and call that when you configure your auto-completion widget (so that the profile being called is not the same one as the search you are running).

Usage

Enable the plugin

  1. Select Plugins from the side navigation pane and click on the Query language - wildcard (truncation) support tile.

  2. From the Location section, select the results page to which you would like to enable this plugin from the Select a results page select list.

The plugin will take effect as soon as you finish running through the plugin setup steps.

Configuration settings

The configuration settings section is where you do most of the configuration for your plugin. The settings enable you to control how the plugin behaves.

The configuration key names below are only used if you are configuring this plugin manually. The configuration keys are set in the results page configuration to configure the plugin. When setting the keys manually you need to type in (or copy and paste) the key name and value.

Maximum number of query terms to use for expansion

Configuration key

plugin.query-wildcard-support.config.partial_query_expansion_index

Data type

integer

Default value

5

Required

This setting is optional

Use the first n suggestions returned from the index for the expanded query.

This plugin calls the auto-completion API to receive a set of suggestions to use for the expanded query.

Setting this to a higher value will result in a larger set of words to query (and potentially more search results). However, this may result in slower query response times.

Prefix mode

Configuration key

plugin.query-wildcard-support.config.prefix_mode

Data type

boolean

Default value

false

Required

This setting is optional

If true, wildcard characters in the query are ignored and expansion is applied to the end of the entire query (e.g. "abc def" behaves as "abc def*"). If false, only terms that explicitly end with * are expanded.

Is autocomplete query?

Configuration key

plugin.query-wildcard-support.config.autocomplete_query

Data type

boolean

Default value

true

Required

This setting is optional

If true, the plugin will be used for search-based auto-completion, sourcing the query terms from the 'partial_query' parameter. If false, it will be used for regular search queries. This only applies when PREFIX_MODE is true.

For Auto Completion mode, the plugin will return wildcard matches based on the input parameter partial query instead of query. If there is no wildcard match for the partial query, the plugin will copy the partial query to the query parameter.

Examples

Standard mode

This example shows how to increase the 'fuzziness' of the expansion, allowing each wildcard occurrence to be replaced with up to 6 terms.

To achieve this configure the plugin with:

Configuration key Value

Maximum number of query terms to use for expansion

6

Prefix mode

false

Prefix mode

The plugin can be configured to support prefix mode. In this mode, the plugin will append a wildcard to the end of the partial query.

Wildcard characters in the query would be ignored if enabling this setting

To achieve this configure the plugin with:

Configuration key Value

Maximum number of query terms to use for expansion

5

Prefix mode

true

Is autocomplete query?

false

Auto-completion mode

When the plugin is configured in prefix mode, the auto-completion mode can be enabled. In this mode, the plugin will return suggestions based on the input parameter partial query instead of query. The suggestions will be returned in the order of relevance, with the most relevant suggestions appearing first.

To achieve this configure the plugin with:

Configuration key Value

Maximum number of query terms to use for expansion

5

Prefix mode

true

Is autocomplete query?

true

Change log

[1.2.1]

Added

  • Added a new configuration option Is autocomplete query? to enable handling auto complete partial query input parameter.

Fixed

  • Fix the bug for Prefix Mode - the whole search term will be used for the query suggestions instead of the last word.

[1.2.0]

Added

  • Added the prefix mode support, so the plugin can facilitate search-based auto-completion which relies on the partial query to be sent without a * on the end.

[1.1.1]

Changed

  • Fixed a bug where the query returns nothing if the auto-completion indexes are missing.

[1.1.0]

Changed

  • Updated to the latest version plugin framework (Funnelback shared v16.20) to enable integration with the new plugin management dashboard.

[1.0.1]

Changed

  • Updated to use a custom isNumeric method as the org.jsoup.helper.StringUtil class was marked for internal use only in Jsoup v1.12.1.