Home > Fluid Dynamics Search Engine > Help > 1172

Advanced Search: Matching substrings instead of whole words

Default behavior and rationale

By default, FDSE matches whole words. Search keyword "eat" will match only whole word "eat", not "eating", "eats", "neat", or "cheat".

This behavior matches the behavior of major search engines like Altavista and Google. Because of this, whole word matching is more likely to match the expectations of your users. Also, these major search engines have probably done studies on which matching behavior works best, so it is probably a good idea to follow their example.

How to globally override this behavior

To make all searches be substring searches, follow these steps:

  1. Install FDSE 2.0.0.0058 or newer.

  2. Go to Admin Page => User Interface => Default Substring Match. Set this setting to 1 (checked).

All keywords will now be treated as substrings rather than whole words.

How to expose this control to end users

To allow your end users to decide whether to search substrings or whole words, follow these steps:

  1. Install FDSE 2.0.0.0058 or newer.

  2. Go to Admin Page => User Interface. Scroll down to the section labeled "Advanced: Edit Templates" and select the Search Form template.

  3. Add the following text to the template:

    <p>
    <input type="radio" name="p:ssm" value="0" /> Match whole words; "eat" will match "eat" <br />
    <input type="radio" name="p:ssm" value="1" /> Match substrings; "eat" will match "beat" and "neat"
    </p>
  4. Go to Admin Page => User Interface => Default Substring Match. Set this to 1 or 0 (checked or unchecked) to control which of the radio buttons will be selected by default when visitors first arrive at your site.

End users will now have control over whether search keywords are treated as substrings or whole words.

Related topics

FDSE also supports matching approximate plural forms (see Advanced Search: Matching approximate plural forms). This feature may better meet your needs. Plural match is somewhat intelligent and can force "family" to match "family" and "families". This is something that substring matching cannot do.

A better overall solution would be to equate synonyms and equivalent spellings (i.e. "color" is equated to "colour") and to reduce all words to their stems (i.e., "explore" and "exploring" and "explores" all map to "explor"). At some point FDSE may support these advanced techniques, but it does not support them now.

History: support for the "Default Substring Match" and "p:ssm" settings were added in FDSE version 2.0.0.0058.


    "Advanced Search: Matching substrings instead of whole words"
    http://www.xav.com/scripts/search/help/1172.html