使用 OCE 工具包为多语言站点编制索引

可以使用 OCE 工具包为多语言 (MLS) 站点编制索引,以进行翻译和页及内容项搜索。

可以构建多语言站点索引,并在发布站点之前对其进行测试。使用 OCE 工具包 cec index-site 命令为多语言站点编制索引。转到 cec-components 目录并发出此命令(不带任何选项),以查看该命令的帮助信息:

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

页索引项按页和语言而存在。为每种语言创建的页索引内容项创建为默认语言页索引项的翻译。在正在运行的站点中进行查询时,搜索和内容列表从站点 URL 中获取语言。这样将自动筛选搜索。

发布多语言站点之前,需要对其编制索引并进行翻译,为此将需要翻译作业。请参见在 Oracle Content Management 服务器中创建新站点或资产翻译作业

默认语言英语是必需的。对于支持的每种语言(必需和可选),执行索引创建并创建索引项的翻译。如果您运行索引两次,其只执行一次更新。

要使用 OCE 工具包命令为多语言站点编制索引,并翻译和发布该站点,请执行以下操作:

  1. 为站点创建内容类型,并使其可在资料档案库中使用。请参见为站点页文本创建内容类型

  2. 选择验证策略。

    1. 单击左侧导航菜单中的资产

    2. 资产菜单中选择本地化策略

    3. 选择本地化策略。

    4. 如果需要,修改本地化策略,以包括要用于编制站点索引和翻译站点的语言。例如,如果策略只包含英语,您可以添加法语和西班牙语。

      所有翻译都是从英语进行。

  3. 下载翻译作业。您只能翻译站点中使用的资产。

  4. 翻译站点。可以手动或通过集成连接器完成站点翻译。

  5. 翻译完成后上载翻译作业。

  6. 使用 cec index-site 命令为站点编制索引。指定 -c <contenttype> 以设置页面索引内容类型。

    还可以指定 -p 选项来发布站点。然后,可以在发布对实时站点的更改之前验证索引和翻译。

    例如,以下 cec index-site 命令为使用英语、法语和西班牙语的站点构建站点索引。站点支持的语言来自分配的 L10n 策略,包括默认语言。

    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. 发布站点以包括翻译。