Azure Web AppsでのPDFファイルのインデックス作成


解説

Sitecore XP 9.1 Initial Releaseより前のバージョンでは、メディアのインデックス作成機能はAzure Web AppsでサポートされていないiFilterに基づいていました。そのため、PDF ファイルを含むblobを含むメディア アイテムのインデックスを作成すると、次の例外がスローされます:

ERROR Could not compute value for ComputedIndexField: _content for indexable: sitecore://master/{8EEE161B-F7D1-4339-AE77-1FA10B8CF8D2}?lang=en&ver=1
Exception: System.Runtime.InteropServices.COMException
Message: Exception from HRESULT: 0x80048605
Source: Sitecore.ContentSearch
   at Sitecore.ContentSearch.Extracters.IFilterTextExtraction.IPersistStream.Load(IStream stream)
   at Sitecore.ContentSearch.Extracters.IFilterTextExtraction.FilterLoader.InitializeFilterAsPersistStream(IFilter filter, String fileName)
   at Sitecore.ContentSearch.Extracters.IFilterTextExtraction.FilterLoader.LoadAndInitIFilter(String fileName, String extension)
   at Sitecore.ContentSearch.Extracters.IFilterTextExtraction.FilterReader..ctor(String fileName)
   at Sitecore.ContentSearch.ComputedFields.MediaItemIFilterTextExtractor.ComputeFieldValue(IIndexable indexable)
   at Sitecore.ContentSearch.ComputedFields.MediaItemContentExtractor.ComputeFieldValue(IIndexable indexable)
   at Sitecore.ContentSearch.Azure.CloudSearchDocumentBuilder.AddComputedIndexFields()

解決策

この問題を解決するには、以下のいずれかのオプションを検討してください:

注意

Sitecore XP 9.1 Initial Release以降、PDF ファイルのコンテンツは、PDFsharpサード パーティ製ライブラリを使用して抽出されるようになりました。ライブラリにはいくつかの制限があり、メディアのインデックス作成時に「Hexadecimal value is an invalid character」エラーが発生する可能性があります。