# How to Configure a Version Search

If you are working with versions, e.g. in the Files module, you can configure and perform a search based on the metadata of versioned objects. This allows you to find object versions without having to search through all the versions manually.

Compared to a regular search configuration, a search for versions has some special criteria:

  • The search for version metadata is not performed on the metadata fields themselves, but on a JSON file that lists all the historical metadata for a version.
  • The search must use relations as search fields based on version_parent_file, e.g.: version_parent_file.title or version_parent_file.metadata.

You can search for version metadata either using the 4ALLPORTAL API or by configuring a search renderer.

Please note: The search only accesses the read-only metadata of the versions. No changes are made to assets or versions as a result of a search.

# Search Renderer Configuration

If you want to provide your users with a search field, you can implement a regular search renderer. You can specify which metadata fields are available for searching.

# Change Configuration

We recommend adding a change configuration. This method allows you to modify the 4ALLPORTAL as required while avoiding collisions in the default.4aprenderer configuration when upgrading the system.
For example, you can use the fields version_parent_file.title, version_parent_file.metadata, or custom relation fields (as version_parent_file.my-custom-field) in an extra version search panel in the default search renderer in the Files module (see the example configuration below).

Alternatively, a version search can be placed just below a custom search renderer configuration.

# Label Translation

Translate your label keys (and optional prompt text or tooltip) in admin snap-in "Translation Studio" or in your file system in file general.properties in folder custom/modules/file/locale/en_US, for example like this:

L-FILE-CE_FILE_VERSION_SEARCH=Search in versions
L-FILE-CE_FILE_FULLTEXT_VERSION-PROMPT=Search for version titles and metadata

# Example Configuration XML

<?xml version="1.0" encoding="UTF-8" ?>
<changes extends="search/default">
  <change xpath="//group_renderer_list" type="add">
    <group_renderer>
      <type>foldable</type>
      <label>L-FILE-CE_FILE_VERSION_SEARCH</label>
      <field_renderer_list>
        <field_renderer>
          <label>L-FILE-CE_FILE_FULLTEXT_VERSION-PROMPT</label>
          <type>Text</type>
          <comparator>LIKE</comparator>
          <operator>OR</operator>
          <wildcard_settings>
            <user>true</user>
            <before>true</before>
            <after>true</after>
          </wildcard_settings>
          <search_fields>
            <search_field>
              <name>version_parent_file.title</name>
              <type>CEVarchar</type>
            </search_field>
            <search_field>
              <name>version_parent_file.metadata</name>
              <type>CEVarchar</type>
            </search_field>
          </search_fields>
        </field_renderer>
      </field_renderer_list>
    </group_renderer>
  </change>
</changes>

Result in the GUI:

Version search renderer

Further information

  • Learn more about changes and their elements here.
  • Learn more about labels and their translations here.
Request missing documentation