Slide 1

Slide 1 text

添付された 日本語テキス トファイルを 全文検索で ヒットさせる 方法 Windows OS 上で Notes/Domino 12.0.2 を使用 中野晴幸 harunakano (twitter) harunakano.blogspot.com (blog)

Slide 2

Slide 2 text

Notes文書に添付した .txt ファイル あなたは「全文検索」で探せますか?

Slide 3

Slide 3 text

.txt ファイルの文字コード • ANSI (Shift-JIS) • Unicode (UTF-8) • EUC • JIS などなど

Slide 4

Slide 4 text

Windowsの「メモ帳」 デフォルトの文字コード • Windows 11 は UTF-8 • Windows 10 も May 2019 Update 以降のデフォルトは UTF-8 以前は「ANSI」 (Shift-JIS)でした

Slide 5

Slide 5 text

全文索引の作成から全文検索まで Update/Updall タスク 全文検索 全文索引 Notes文書 検索結果 文字 添付 添付 コンバージョン フィルタ 文字 文字抽出

Slide 6

Slide 6 text

コンバージョン・フィルタとは • ファイル内にあるテキストデータを抽出 • 様々な種類のファイルに対応

Slide 7

Slide 7 text

Dominoのコンバージョンフィルタ • 文書にある添付ファイルのうち、対応している種類のファイル 内にあるテキストを抽出する • 10.0 で KeyView から Apache Tika 1.18 に変わる https://help.hcltechsw.com/domino/10.0.1/wn_apache_tika_used_for_attachment_searches.html • 12.0.2 で Apache Tika のバージョンは 2.4.1 へアップグレード https://help.hcltechsw.com/domino/12.0.2/ja/admin/wn_administration_features.html

Slide 8

Slide 8 text

12.0.2 は UTF-8 の.txt ファイルのみ サポート? https://help.hcltechsw.com/domino/12.0.2/ja/admin/admn_attachment_indexing.html

Slide 9

Slide 9 text

11.0.1 FP3 は Shift-JIS の .txt ファイルも サポート!? https://support.hcltechsw.com/csm?id=kb_article&sysparm_article=KB0076353

Slide 10

Slide 10 text

Notes/Domino 12.0.2 で どの文字コードの日本語テキ ストファイルが検索できるか 試してみた Shift-JIS と UTF-8 の両方サポートしてるのでしょうか...

Slide 11

Slide 11 text

6つのNotes文書に同じ文章

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

> load updall -X ftstest1202.nsf [15FC:0002-0850] Start indexing document 0x8F6 (0 text bytes indexed) [15FC:0002-0850] Close document 0x8F6 (1361 text bytes indexed) [15FC:0002-0850] Start indexing document 0x8FA (1361 text bytes indexed) [15FC:0002-0850] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.txt' Size = 888 using Brute Force [15FC:0002-0850] Close document 0x8FA (2793 text bytes indexed) [15FC:0002-0850] Start indexing document 0x8FE (2793 text bytes indexed) [15FC:0002-0850] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.txt' Size = 1330 using Brute Force [15FC:0002-0850] Close document 0x8FE (2887 text bytes indexed) [15FC:0002-0850] Start indexing document 0x902 (2887 text bytes indexed) [15FC:0002-0850] Not indexing '吾輩は猫である。名前はまだない。Shift-JIS.zip' because it's extension appears in the ignore attachment types list [15FC:0002-0850] Close document 0x902 (2940 text bytes indexed) [15FC:0002-0850] Start indexing document 0x906 (2940 text bytes indexed) [15FC:0002-0850] Not indexing '吾輩は猫である。名前はまだない。UTF-8.zip' because it's extension appears in the ignore attachment types list [15FC:0002-0850] Close document 0x906 (2989 text bytes indexed) [15FC:0002-0850] Start indexing document 0x90A (2989 text bytes indexed) [15FC:0002-0850] Indexing Attachment Object: '吾輩は猫である。名前はまだない。.pdf' Size = 189222 using Tika [15FC:0002-0850] Close document 0x90A (4487 text bytes indexed) [15FC:0002-0850] 2023/03/10 08:17:14 6 documents (4631 bytes) indexed in C:¥Domino¥Data¥ftstest1202.nsf [15FC:0002-0850] 2023/03/10 08:17:14 Index update process shutdown notes.ini に デバッグパラメータを追加すると、 .txt ファイルに Tika が使われていないことがわかった( Brute Force が使われた) ※コンソールログから抜粋

Slide 14

Slide 14 text

(デフォルトでは) .txt ファイルに Tika を使わない • .txtファイルからのテキスト抽出は Tika ではなく Domino 側の 機能(brute force)で行われた ※追加したデバッグパラメータ DEBUG_FTV_INDEX=2 DEBUG_FTV_search=1 DEBUG_FT_STREAM=15 DEBUG_TIKA=1

Slide 15

Slide 15 text

.txt は Shift-JIS のみヒット

Slide 16

Slide 16 text

notes.ini に FT_USE_ATTACHMENT_WHITE_LIST=1 を追加する と、.zip 内のファイルが検索可能になる > load updall -X FTStest1202.nsf [15E8:0002-083C] Start indexing document 0x8F6 (0 text bytes indexed) [15E8:0002-083C] Close document 0x8F6 (1361 text bytes indexed) [15E8:0002-083C] Start indexing document 0x8FA (1361 text bytes indexed) [15E8:0002-083C] Not indexing '吾輩は猫である。名前はまだない。Shift-JIS.txt' because of ignore attachment type which the enabled whitelist doesn't override [15E8:0002-083C] Close document 0x8FA (1401 text bytes indexed) [15E8:0002-083C] Start indexing document 0x8FE (1401 text bytes indexed) [15E8:0002-083C] Not indexing '吾輩は猫である。名前はまだない。UTF-8.txt' because of ignore attachment type which the enabled whitelist doesn't override [15E8:0002-083C] Close document 0x8FE (1437 text bytes indexed) [15E8:0002-083C] Start indexing document 0x902 (1437 text bytes indexed) [15E8:0002-083C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.zip' Size = 790 using Tika [15E8:0002-083C] Close document 0x902 (2958 text bytes indexed) [15E8:0002-083C] Start indexing document 0x906 (2958 text bytes indexed) [15E8:0002-083C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.zip' Size = 857 using Tika [15E8:0002-083C] Close document 0x906 (4467 text bytes indexed) [15E8:0002-083C] Start indexing document 0x90A (4467 text bytes indexed) [15E8:0002-083C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。.pdf' Size = 189222 using Tika [15E8:0002-083C] Close document 0x90A (5965 text bytes indexed) [15E8:0002-083C] 2023/03/10 07:46:11 6 documents (6109 bytes) indexed in C:¥Domino¥Data¥FTStest1202.nsf [15E8:0002-083C] 2023/03/10 07:46:11 Index update process shutdown ※コンソールログから抜粋

Slide 17

Slide 17 text

2つの .txt はヒットしないが 2つの .zip はヒットした

Slide 18

Slide 18 text

notes.ini に FT_USE_MY_ATTACHMENT_WHITE_LIST=1 FT_INDEX_FILTER_ATTACHMENT_TYPES=*.txt,*.zip を追加すると、対象のファイルタイプを指定できる > load updall -X ftstest1202.nsf [0884:0002-1BB8] Start indexing document 0x8F6 (0 text bytes indexed) [0884:0002-1BB8] Close document 0x8F6 (1361 text bytes indexed) [0884:0002-1BB8] Start indexing document 0x8FA (1361 text bytes indexed) [0884:0002-1BB8] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.txt' Size = 888 using Brute Force [0884:0002-1BB8] Close document 0x8FA (2793 text bytes indexed) [0884:0002-1BB8] Start indexing document 0x8FE (2793 text bytes indexed) [0884:0002-1BB8] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.txt' Size = 1330 using Brute Force [0884:0002-1BB8] Close document 0x8FE (2887 text bytes indexed) [0884:0002-1BB8] Start indexing document 0x902 (2887 text bytes indexed) [0884:0002-1BB8] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.zip' Size = 790 using Tika [0884:0002-1BB8] Close document 0x902 (4408 text bytes indexed) [0884:0002-1BB8] Start indexing document 0x906 (4408 text bytes indexed) [0884:0002-1BB8] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.zip' Size = 857 using Tika [0884:0002-1BB8] Close document 0x906 (5917 text bytes indexed) [0884:0002-1BB8] Start indexing document 0x90A (5917 text bytes indexed) [0884:0002-1BB8] Not indexing '吾輩は猫である。名前はまだない。.pdf' because of ignore attachment type which the enabled whitelist doesn't override [0884:0002-1BB8] Close document 0x90A (5947 text bytes indexed) [0884:0002-1BB8] 2023/03/10 07:58:24 6 documents (6091 bytes) indexed in C:¥Domino¥Data¥ftstest1202.nsf [0884:0002-1BB8] 2023/03/10 07:58:24 Index update process shutdown ※コンソールログから抜粋

Slide 19

Slide 19 text

Shift-JIS の .txt と .zip 内にある2つの .txt が検索できた

Slide 20

Slide 20 text

サポートへ問合せると Domino 12.0.2 の HotFix が提供された • インストーラを実行するとNotes/Dominoを終了しているにも 関わらず「終了してから実行しろ」と叱られた • 別の環境へはインストールできた。HotFixを有効にするため、 次の notes.ini パラメータの追加と全文索引の再構築が必要 FT_USE_MY_ATTACHMENT_BRUTE_LIST=1

Slide 21

Slide 21 text

HotFix適用+ notes.ini パラメータ追加後 全文索引を再構築 > load updall -X FTSTest1202.nsf [0488:0002-1740] Start indexing document 0x8F6 (0 text bytes indexed) [0488:0002-1740] Close document 0x8F6 (1361 text bytes indexed) [0488:0002-1740] Start indexing document 0x8FA (1361 text bytes indexed) [0488:0002-1740] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.txt' Size = 888 using Tika [0488:0002-1740] Close document 0x8FA (2792 text bytes indexed) [0488:0002-1740] Start indexing document 0x8FE (2792 text bytes indexed) [0488:0002-1740] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.txt' Size = 1330 using Tika [0488:0002-1740] Close document 0x8FE (4215 text bytes indexed) [0488:0002-1740] Start indexing document 0x902 (4215 text bytes indexed) [0488:0002-1740] Not indexing '吾輩は猫である。名前はまだない。Shift-JIS.zip' because it's extension appears in the ignore attachment types list [0488:0002-1740] Close document 0x902 (4268 text bytes indexed) [0488:0002-1740] Start indexing document 0x906 (4268 text bytes indexed) [0488:0002-1740] Not indexing '吾輩は猫である。名前はまだない。UTF-8.zip' because it's extension appears in the ignore attachment types list [0488:0002-1740] Close document 0x906 (4317 text bytes indexed) [0488:0002-1740] Start indexing document 0x90A (4317 text bytes indexed) [0488:0002-1740] Indexing Attachment Object: '吾輩は猫である。名前はまだない。.pdf' Size = 189222 using Tika [0488:0002-1740] Close document 0x90A (5815 text bytes indexed) [0488:0002-1740] 2023/03/07 19:57:04 6 documents (5959 bytes) indexed in C:¥Domino¥Data¥FTSTest1202.nsf [0488:0002-1740] 2023/03/07 19:57:04 Index update process shutdown FT_USE_MY_ATTACHMENT_BRUTE_LIST=1 ※コンソールログから抜粋

Slide 22

Slide 22 text

Shift-JIS, UTF-8 の両方がヒットした

Slide 23

Slide 23 text

どうせなら .zip 内の Shift-JIS, UTF-8 の.txtも検索にヒットさせたい

Slide 24

Slide 24 text

FT_USE_MY_ATTACHMENT_BRUTE_LIST=1 FT_USE_MY_ATTACHMENT_WHITE_LIST=1 FT_INDEX_FILTER_ATTACHMENT_TYPES=*.txt,*.zip,*.pdf > load updall -X FTSTest1202.nsf [0744:0002-073C] Start indexing document 0x8F6 (0 text bytes indexed) [0744:0002-073C] Close document 0x8F6 (1361 text bytes indexed) [0744:0002-073C] Start indexing document 0x8FA (1361 text bytes indexed) [0744:0002-073C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.txt' Size = 888 using Tika [0744:0002-073C] Close document 0x8FA (2792 text bytes indexed) [0744:0002-073C] Start indexing document 0x8FE (2792 text bytes indexed) [0744:0002-073C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.txt' Size = 1330 using Tika [0744:0002-073C] Close document 0x8FE (4215 text bytes indexed) [0744:0002-073C] Start indexing document 0x902 (4215 text bytes indexed) [0744:0002-073C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。Shift-JIS.zip' Size = 790 using Tika [0744:0002-073C] Close document 0x902 (5736 text bytes indexed) [0744:0002-073C] Start indexing document 0x906 (5736 text bytes indexed) [0744:0002-073C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。UTF-8.zip' Size = 857 using Tika [0744:0002-073C] Close document 0x906 (7245 text bytes indexed) [0744:0002-073C] Start indexing document 0x90A (7245 text bytes indexed) [0744:0002-073C] Indexing Attachment Object: '吾輩は猫である。名前はまだない。.pdf' Size = 189222 using Tika [0744:0002-073C] Close document 0x90A (8743 text bytes indexed) [0744:0002-073C] 2023/03/07 21:07:37 6 documents (8887 bytes) indexed in C:¥Domino¥Data¥FTSTest1202.nsf [0744:0002-073C] 2023/03/07 21:07:37 Index update process shutdown ※コンソールログから抜粋

Slide 25

Slide 25 text

全文書ヒットした\( 'ω')/

Slide 26

Slide 26 text

Domino 12.0.2 で .txt の全文検索結果 設定など 文字の抽出 全文検索の結果 デフォルト brute force Shift-JIS のみ FT_USE_ATTACHMENT_WHITE_LIST=1 索引化されない ヒットしない FT_USE_MY_ATTACHMENT_WHITE_LIST=1 FT_INDEX_FILTER_ATTACHMENT_TYPES=*.txt,*.zip brute force Shift-JIS のみ HotFix 14 適用 FT_USE_MY_ATTACHMENT_BRUTE_LIST=1 Tika ヒットする

Slide 27

Slide 27 text

まとめ • Domino 12.0.2 (FixPack適用なし)の全文検索で UTF-8 の.txt をヒットさせるには HotFix の適用が必要です • ファイルの拡張子だけでなく文字コードが対応していることも 確認しましょう • 「サポートしている」とは言え、デフォルトでは検索できない 拡張子があります。Tika がサポートしているけど検索できない 拡張子のファイルがあれば、 FT_USE_MY_ATTACHMENT_WHITE_LIST=1 に加え、 FT_INDEX_FILTER_ATTACHMENT_TYPES= で全ての拡張子 を指定してみましょう