legacy-knowledge-base
公開されました Jul. 2, 2025

JournalArticle が適切にインデックス付けされず、「Document contains at least one immense term」というエラーが表示される

written-by

Katlyn Lee

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • 再インデックスを実行しようとすると、次のようなエラーが原因で、JournalArticle コンテンツが適切にインデックス化されません:
    Solr の場合:
    2020-09-23 06:32:13 ERROR org.apache.solr.common.SolrException: Exception writing document 
    id com.liferay.journal.model.JournalArticle_PORTLET_441133 to the index; possible analysis error:
    Document contains at least one immense term in field="ddm__keyword__54485__column_en_US"
    (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please
    correct the analyzer to not produce such terms. The prefix of the first immense term is: '[60, 116,
    97, 98, 108, 101, 32, 98, 111, 114, 100, 101, 114, 61, 34, 48, 34, 32, 99, 101, 108, 108, 112, 97,
    100, 100, 105, 110, 103, 61]...', original message: bytes can be at most 32766 in length; got 41906.
    Perhaps the document has an indexed string field (solr.StrField) which is too large
    Elasticsearch の場合:
    2021-02-04 00:36:01.854 ERROR [liferay/search_writer/SYSTEM_ENGINE-1][BulkDocumentRequestExecutorImpl:53]
    failure in bulk execution:_[6011]: index [liferay-10154], type [LiferayDocumentType],
    id [com.liferay.journal.model.JournalArticle_PORTLET_947074], message
    [java.lang.IllegalArgumentException:
    Document contains at least one immense term in field="ddm__keyword__1499431__body_el_GR" (whose UTF8 encoding is longer than the max length 32766),
    all of which were skipped. Please correct the analyzer to not produce such terms.
    The prefix of the first immense term is: '[-31, -68, -120, -49, -128, -49, -116, 32, -49,
    -124, -50, -84, -49, -126, 32, -31, -68, -128, -49, -127, -49,
    -121, -50, -84, -49, -126, 32, -49, -124, -50]...', original message:
    bytes can be at most 32766 in length; got 47534]_[6029]:
    2021-02-04 00:36:01.930 ERROR [liferay/search_writer/SYSTEM_ENGINE-1]
    [ElasticsearchIndexWriter:409] Bulk update failed

Environment

  • DXP 7.2
  • DXP 7.1
  • DXP 7.0

解決策

  • このエラーは、カスタム Web コンテンツストラクチャのフィールドがキーワードとしてインデックス可能に設定されていることを示しています。 ただし、これらのフィールドに大量のテキストがある場合、コンテンツがキーワードに設定された 32766 文字の制限を超えているため、適切にインデックスを作成できません。
  • このエラーを軽減するには、これらのフィールド設定を、文字数制限のないテキストとしてインデックス可能なものに変更する必要がある。
    1. インデックス可能 - キーワードをインデックス タイプとして含むフィールドを含むストラクチャを見つけるには、データベースで次のクエリを実行します:
      SELECT * FROM ddmstructure WHERE definition LIKE '%"indexType":"keyword"%';
    2. 出力からカスタムストラクチャを特定し、UI でこれらのストラクチャを見直して、大量のテキストを含むすべてのフィールドのインデックスタイプが キーワードではなく テキストであることを確認します
      1. UI で、サイト管理 > コンテンツ > Web コンテンツ > ストラクチャに移動します。
      2. クエリ出力でストラクチャを検索して編集します
      3. 以下のスクリーンショットに示すように、ストラクチャフィールドを調べて、フィールドが インデックス可能 - テキスト に設定されていることを確認します。

        mceclip0.png

 

did-this-article-resolve-your-issue

legacy-knowledge-base