Skip to content

Search for partial words in galleries

The search function in OpenCms galleries can now optionally return results where the entered search term is only part of a longer word. This makes it easier, for example, to search for images and downloads using compound terms.

This means that compound terms no longer need to be known in full or entered exactly as they appear. Searching for a word component contained within a term can also return the appropriate resource. The new search behavior applies to all OpenCms galleries, including images and downloads.

User preferences for gallery search User preferences for gallery search

The new “Gallery search word handling” option is available in the personal user settings. The following options can be selected:

  • Match whole words only: The search terms are used as entered.
  • Match any part of words: Search terms can also match within longer words.

Administrators can define the default setting centrally. Each user can then adjust it according to their personal preference.

When “Match any part of words” is enabled, OpenCms automatically extends search terms internally. For example, an image tagged with the keyword “motorcycle” can also be found by searching for

  • motor
  • cycle

Capitalization affects how a term is interpreted. A term beginning with a lowercase letter can match anywhere within a word. For example, cycle finds “motorcycle”. A term beginning with an uppercase letter is treated as the beginning of a word. For example, Motor finds “Motorcycle”, while Cycle does not.

Existing advanced searches containing wildcards, quotation marks or search operators are not modified automatically.

Partial-word searches generally produce more results than searches for whole words. This can also display resources that were not intended by the user. Examples include:

  • art can also match article, smart, department or artwork.
  • press can also match expression, pressure or espresso.
  • form can also match reform, uniform or platform.

For short search terms, users should therefore review the results or enter a longer and more specific term. There is no minimum length for search terms.