Index a Multilingual Site with OCE Toolkit

You can use OCE Toolkit to index multilingual (MLS) sites for translations and for searching pages and content items.

You can build a multilingual site index and test it before publishing the site. Use the OCE Toolkit cec index-site command to index a multilingual site. Go to the cec-components directory and issue this command without any options to view the help information for the command:

cec-components> cec index-site
Usage: cec index-site <site>

Create content item for each page with all text on the page. If the page index content item already exists for a pate, updated it with latest
text on the page. Specify -c <contenttype> to set the page index content type. Optionally specify -p to publish the page index items after
creation or update.

Options:
  --contenttype, -c <contenttype> page index content type
  --publish, -p     publish page index items
  --help, -h        Show help                                                                                                        [boolean]

Examples:
  cec index-site Site1 -c PageIndex
  cec index-site Site1 -c PageIndex -p

Page index items exist per page and per language. The page index content items created for each language are created as translations of the default language page index items. When you do a query in the running site, the search and the content list pick up the language from the site URL. This filters the search automatically.

Before you can publish a multilingual site, you need to index and translate it, for which you will need a translation job. See Create a New Site or Asset Translation Job in the Oracle Content and Experience Server.

The default language, English, is required. For each language supported (required and optional), execute the index creation and create translations of index items. If you run the index twice, it just does an update.

To index, translate, and publish a multilingual site using OCE Toolkit commands:

  1. Create a content type for the site and make it available in the repository. See Create the Content Type for Site Page Text.

  2. Select a validation policy.

    1. Click Assets in the left navigation menu.

    2. Choose Localization Policies in the Assets menu.

    3. Select a localization policy.

    4. Modify the localization policy, if necessary, to include the languages you want to use for indexing and translating the site. For example, if the policy has only English, you can add French and Spanish.

      All translations are done from English.

  3. Download a translation job. You can translate only the assets that are used in the site.

  4. Translate the site. Site translations can be done manually or through an integrated connector.

  5. Upload the translation job once translation is finished.

  6. Use the cec index-site command to index the site. Specify -c <contenttype> to set the page index content type.

    You can also specify the -p option to publish the site. Then you can validate the indexing and translation before publishing the changes to the live site.

    For example, the following cec index-site command builds a site index for a site that uses English, French, and Spanish. The languages supported by the site are from the assigned L10n policy, including the default language.

    cec index-site Demo2 -c search_content_type -p
     - Logged in to remote server: server-URL
     - establish user session
     - get CSRF token
     - site: Demo2, default language: en-US, channel token: channel-token
     - site localization policy: search_localization_policy
     - query site repository
     - query content type search_content_type
     - query site structure
     - content types used in the site: search_blog
     - query page data
     - query content on the pages
     - will create 11 page index items
     - will update 0 page index items
     - will remove 1 page index items
     - create page index item for Blog
     - create page index item for Privacy Policy
     - create page index item for Search
     - create page index item for Components
     - create page index item for Navigtion
     - create page index item for Detail Page
     - create page index item for Pages
     - create page index item for Page Content
     - create page index item for Developing Templates
     - create page index item for Themes
     - add page index items to site channel
     - remove page index items for page Search from site channel
     - will create/update translate for fx-FR,es-ES
     - query site stucture with locale fr-FR
     - query page data (fr-FR)
     - query content on the pages (fr-FR)
     - will create 11 page index items (fr-FR)
     - will update 0 page index items (fr-FR)
     - will remove 1 page index items (fr-FR)
     - create page index item for Themes (fr-FR)
     - create page index item for Navigation (fr-FR)
     - create page index item for Pages (fr-FR)
     - create page index item for Detail Page (fr-FR)
     - create page index item for Search (fr-FR)
     - create page index item for Page Content (fr-FR)
     - create page index item for Components (fr-FR)
     - create page index item for Developing Templates (fr-FR)
     - create page index item for Blog (fr-FR)
     - create page index item for Home (fr-FR)
     - create page index item for Privacy Policy (fr-FR)
     - add page index items to site channel
     - set page index items in fr-FR as translated
     - remove page index items for page Search from site channel
     - query site stucture with locale es-ES
     - query page data (es-ES)
     - query content on the pages (es-ES)
     - will create 11 page index items (es-ES)
     - will create 0 page index items (es-ES)
     - create page index item for Pages (en-ES)
     - create page index item for Home (en-ES)
     - create page index item for Themes (en-ES)
     - create page index item for Components (en-ES)
     - create page index item for Privacy Policy (en-ES)
     - create page index item for Detail Page (en-ES)
     - create page index item for Page Content (en-ES)
     - create page index item for Navigation (en-ES)
     - create page index item for Developing Templates (en-ES)
     - create page index item for Search (en-ES)
     - create page index item for Blog (en-ES)
     - add page index items to site channel
     - set page index items in es-ED as translated
     - publish job submitted
     - publish in proogress
     - publish in progress
     - publish page index items finished
  7. Publish the site to include translations.