概要
Microsoft 365コネクタは、Microsoft 365サービス(OneDrive、OneNote、Teams、SharePoint)からデータを取得して Fess のインデックスに登録する機能を提供します。
この機能には fess-ds-microsoft365 プラグインが必要です。
対応サービス
OneDrive: ユーザードライブ、グループドライブ、共有ドキュメント
OneNote: ノートブック(サイト、ユーザー、グループ)
Teams: チャネル、メッセージ、チャット
SharePoint Document Libraries: ドキュメントライブラリメタデータ
SharePoint Lists: リストとリストアイテム
SharePoint Pages: サイトページ、ニュース記事
前提条件
プラグインのインストールが必要です
Azure ADアプリケーション登録が必要です
Microsoft Graph API権限の設定と管理者同意が必要です
Java 21以上、Fess 15.2.0以上
プラグインのインストール
方法1: JARファイルを直接配置
# Maven Centralからダウンロード
wget https://repo1.maven.org/maven2/org/codelibs/fess/fess-ds-microsoft365/X.X.X/fess-ds-microsoft365-X.X.X.jar
# 配置
cp fess-ds-microsoft365-X.X.X.jar $FESS_HOME/app/WEB-INF/lib/
# または
sudo cp fess-ds-microsoft365-X.X.X.jar /usr/share/fess/app/WEB-INF/lib/
方法2: ソースからビルド
git clone https://github.com/codelibs/fess-ds-microsoft365.git
cd fess-ds-microsoft365
mvn clean package
cp target/fess-ds-microsoft365-*.jar $FESS_HOME/app/WEB-INF/lib/
インストール後、Fess を再起動してください。
設定方法
管理画面から「クローラー」→「データストア」→「新規作成」で設定します。
基本設定
| 項目 | 設定例 |
|---|---|
| 名前 | Microsoft 365 OneDrive |
| ハンドラ名 | OneDriveDataStore / OneNoteDataStore / TeamsDataStore / SharePointDocLibDataStore / SharePointListDataStore / SharePointPageDataStore |
| 有効 | オン |
パラメーター設定(共通)
tenant=12345678-1234-1234-1234-123456789abc
client_id=87654321-4321-4321-4321-123456789abc
client_secret=abcdefghijklmnopqrstuvwxyz123456
number_of_threads=1
ignore_error=false
共通パラメーター一覧
| パラメーター | 必須 | 説明 |
|---|---|---|
tenant | はい | Azure ADテナントID |
client_id | はい | アプリ登録のクライアントID |
client_secret | はい | アプリ登録のクライアントシークレット |
number_of_threads | いいえ | 並列処理スレッド数(デフォルト: 1) |
ignore_error | いいえ | エラー時も処理を継続(デフォルト: false) |
include_pattern | いいえ | 含めるコンテンツの正規表現パターン |
exclude_pattern | いいえ | 除外するコンテンツの正規表現パターン |
default_permissions | いいえ | デフォルトロール割り当て |
Azure ADアプリケーション登録
1. Azure Portalでアプリケーションを登録
https://portal.azure.com でAzure Active Directoryを開く:
「アプリの登録」→「新規登録」をクリック
アプリケーション名を入力
サポートされているアカウントの種類を選択
「登録」をクリック
2. クライアントシークレットの作成
「証明書とシークレット」で:
「新しいクライアントシークレット」をクリック
説明と有効期限を設定
シークレット値をコピー(後で確認できないので注意)
3. API権限の追加
「APIのアクセス許可」で:
「アクセス許可の追加」をクリック
「Microsoft Graph」を選択
「アプリケーションの許可」を選択
必要な権限を追加(下記参照)
「管理者の同意を与えます」をクリック
データストア別の必要な権限
OneDriveDataStore
必須権限:
Files.Read.All
条件付き権限:
User.Read.All- user_drive_crawler=true の場合Group.Read.All- group_drive_crawler=true の場合Sites.Read.All- shared_documents_drive_crawler=true の場合
OneNoteDataStore
必須権限:
Notes.Read.All
条件付き権限:
User.Read.All- user_note_crawler=true の場合Group.Read.All- group_note_crawler=true の場合Sites.Read.All- site_note_crawler=true の場合
TeamsDataStore
必須権限:
Team.ReadBasic.AllGroup.Read.AllChannel.ReadBasic.AllChannelMessage.Read.AllChannelMember.Read.AllUser.Read.All
条件付き権限:
Chat.Read.All- chat_id を指定する場合Files.Read.All- append_attachment=true の場合
スクリプト設定
OneDrive
title=file.name
content=file.description + "\n" + file.contents
mimetype=file.mimetype
created=file.created
last_modified=file.last_modified
url=file.web_url
role=file.roles
利用可能なフィールド:
file.name- ファイル名file.description- ファイルの説明file.contents- テキストコンテンツfile.mimetype- MIMEタイプfile.filetype- ファイルタイプfile.created- 作成日時file.last_modified- 最終更新日時file.size- ファイルサイズfile.web_url- ブラウザで開くURLfile.roles- アクセス権限
OneNote
title=notebook.name
content=notebook.contents
created=notebook.created
last_modified=notebook.last_modified
url=notebook.web_url
role=notebook.roles
size=notebook.size
利用可能なフィールド:
notebook.name- ノートブック名notebook.contents- セクションとページの統合コンテンツnotebook.size- コンテンツサイズ(文字数)notebook.created- 作成日時notebook.last_modified- 最終更新日時notebook.web_url- ブラウザで開くURLnotebook.roles- アクセス権限
Teams
title=message.title
content=message.content
created=message.created_date_time
last_modified=message.last_modified_date_time
url=message.web_url
role=message.roles
利用可能なフィールド:
message.title- メッセージタイトルmessage.content- メッセージコンテンツmessage.created_date_time- 作成日時message.last_modified_date_time- 最終更新日時message.web_url- ブラウザで開くURLmessage.roles- アクセス権限message.from- 送信者情報
データストア別の追加パラメーター
OneDrive
max_content_length=-1
ignore_folder=true
supported_mimetypes=.*
drive_id=
shared_documents_drive_crawler=true
user_drive_crawler=true
group_drive_crawler=true
OneNote
site_note_crawler=true
user_note_crawler=true
group_note_crawler=true
Teams
team_id=
exclude_team_ids=
include_visibility=
channel_id=
chat_id=
ignore_replies=false
append_attachment=true
ignore_system_events=true
title_dateformat=yyyy/MM/dd'T'HH:mm:ss
title_timezone_offset=Z
SharePoint Document Libraries
site_id=
exclude_site_id=
ignore_system_libraries=true
SharePoint Lists
site_id=hostname,siteCollectionId,siteId
list_id=
exclude_list_id=
list_template_filter=
ignore_system_lists=true
SharePoint Pages
site_id=
exclude_site_id=
ignore_system_pages=true
page_type_filter=
使用例
OneDrive全ドライブのクロール
パラメーター:
tenant=12345678-1234-1234-1234-123456789abc
client_id=87654321-4321-4321-4321-123456789abc
client_secret=your_client_secret
user_drive_crawler=true
group_drive_crawler=true
shared_documents_drive_crawler=true
スクリプト:
title=file.name
content=file.description + "\n" + file.contents
mimetype=file.mimetype
created=file.created
last_modified=file.last_modified
url=file.web_url
role=file.roles
特定チームのTeamsメッセージをクロール
パラメーター:
tenant=12345678-1234-1234-1234-123456789abc
client_id=87654321-4321-4321-4321-123456789abc
client_secret=your_client_secret
team_id=19:abc123def456@thread.tacv2
ignore_replies=false
append_attachment=true
title_timezone_offset=+09:00
スクリプト:
title=message.title
content=message.content
created=message.created_date_time
url=message.web_url
role=message.roles
トラブルシューティング
認証エラー
症状: Authentication failed または Insufficient privileges
確認事項:
テナントID、クライアントID、クライアントシークレットが正しいか確認
Azure Portalで必要なAPI権限が付与されているか確認
管理者の同意が与えられているか確認
クライアントシークレットの有効期限を確認
APIレート制限エラー
症状: 429 Too Many Requests
解決方法:
number_of_threadsを減らす(1または2に設定)クロール間隔を長くする
ignore_error=trueを設定して継続処理
データが取得できない
症状: クロールは成功するがドキュメントが0件
確認事項:
対象のデータが存在するか確認
API権限が正しく設定されているか確認
ユーザー/グループドライブクローラーの設定を確認
ログでエラーメッセージを確認
大量データのクロール
解決方法:
複数のデータストアに分割(サイト単位、ドライブ単位など)
スケジュール設定で負荷分散
number_of_threadsを調整して並列処理特定のフォルダ/サイトのみをクロール
参考情報
データストアコネクタの概要 - データストアコネクタ概要
Google Workspaceコネクタ - Google Workspaceコネクタ
データストアクロール - データストア設定ガイド