会社の古いドキュメントシステムのドキュメントをGoogleドキュメントとしてGoogleドライブに変換するスクリプトを作成しました。ただし、マイドライブでこれらのドキュメントにあることがわかっている単語を検索しても、結果のリストには返されません。これらのドキュメントの1つを開いて編集すると、今後の検索で結果として返される可能性があります。
小さなスクリプトでこれを再現することができました
function newDoc() {
var title = "Document Search Testing ";
var txt = "You can't handle the truth! Son, we live in a world that has walls, and those walls have to be guarded by men with guns. Who's gonna do it? You? You, Lieutenant Weinberg? I have a greater responsibility than you can possibly fathom! You weep for Santiago and you curse the Marines. You have that luxury. You have the luxury of not knowing what I know: that Santiago's death, while tragic, probably saved lives. And my existence, while grotesque and incomprehensible to you, saves lives! You don't want the truth, because deep down in places you don't talk about at parties, you want me on that wall! You need me on that wall! We use words like honor, code, loyalty. We use these words as the backbone of a life spent defending something. You use them as a punchline! I have neither the time nor the inclination to explain myself to a man who rises and sleeps under the blanket of the very freedom that I provide, and then questions the manner in which I provide it! I would rather you just said Thank you, and went on your way. Otherwise, I suggest you pick up a weapon, and stand a post. Either way, I don't give a damn what you think you are entitled to!";
for (i=0; i<3; i++) {
var doc = DocumentApp.create(title + i);
doc.appendParagraph(txt);
doc.appendParagraph(" ");
doc.appendParagraph("the end");
doc.saveAndClose();
}
"done";
}
次に、「ドキュメント検索テストマニュアル」というドキュメントを手動で作成し、同じ映画の引用を貼り付けました。次に、検索語「武器」を使用してマイドライブを検索し、次の結果を受け取りました。
9/11@10:47 Created via script
Document Search Testing 0
Document Search Testing 1
Document Search Testing 2
9/11@10:50 manually created (copied text)
Document Search Testing Manual
9/11@10:52 searched on 'weapon', only hit is the script document
9/11@11:38 searched on 'weapon', receive hits for the script itself and the manual document none of the script created ones
9/11@14:00 searched on 'weapon', hits for the script and the manual document only
9/12@10:00 searched on 'weapon', hits for the script and the manual document only
9/12@10:01 opened 'Document Search Testing 0', clicked around in document, made no changes, closed document
9/12@10:02 opened 'Document Search Testing 1', added a line to the first paragraph, closed document
9/12@10:05 searched on 'weapon', receive hits for the script document, manual document, and Testing 1. Testing 0 and Testing 2 are still not found
9/12@17:40 searched on 'weapon', receive hits for the script document, manual document, and Testing 1. Testing 0 and Testing 2 are still not found
スクリプトを介してドキュメントを作成し、検索用にインデックスを作成するときに、他にやるべきことはありますか。ドキュメントを見回しましたが、何も表示されません。