ファイル・システム・クロールのSourceConfigオブジェクトには、"File System"を指定するModuleId、シードを指定するModulePropertyおよびオプションのソース・プロパティのその他のModulePropertyオブジェクトが必要です。
ファイル・システムのモジュール・プロパティ・キー | キー値 |
---|---|
seeds | seedsプロパティは、キー/複数値のペアです。キーは、seedsで、複数値ペアは、ファイルまたはフォルダに対する1つ以上の文字列です。シードとして使用されるファイル・パスには、絶対パスを指定する必要があります。必須です。 |
gatherNativeFileProperties | gatherNativeFilePropertiesプロパティ(trueに設定されている場合)を使用すると、クロールで、Windows ACLプロパティ(例: Endeca.FileSystem.ACL.AllowRead)またはUNIXの所有者、グループおよび読取り可能なプロパティ(例: Endeca.FileSystem.IsOwnerReadable)などの、オペレーティング・システムレベルのプロパティを収集できます。デフォルトは、falseです。オプションです。 |
expandArchives | expandArchivesプロパティ(trueに設定されている場合)を使用すると、クロールでアーカイブされたエントリを展開できます。このプロパティを有効にすると、アーカイブされたエントリごとにEndecaレコードが作成され、レコードのプロパティが移入されます。ドキュメント変換オプションを有効化すると、テキストが抽出されます。オプションを有効化していても、クロールは、アーカイブされたエントリのネイティブ・ファイル・プロパティを収集しないことに注意してください。デフォルトはfalseです。オプションです。 |
// Connect to the IAS Server. ServiceAddress address = new ServiceAddress("localhost", 8401, contextPath); IasCrawlerLocator locator = IasCrawlerLocator.create(address); IasCrawler crawler = locator.getService(); // Create a new crawl Id with the name set to Demo. CrawlId crawlId = new CrawlId("Demo"); // Create the crawl configuration. CrawlConfig crawlConfig = new CrawlConfig(crawlId); // Create the source configuration. SourceConfig sourceConfig = new SourceConfig(); // Create a file system module ID. ModuleId moduleId = new ModuleId("File System"); // Set the module ID in the source config. sourceConfig.setModuleId(moduleId); // Create a module property object for the seeds. ModuleProperty seeds = new ModuleProperty(); // Set the key for seeds. seeds.setKey("seeds"); // Set multiple values for seeds. seeds.setValues("C:\\tmp\\iasdocset","C:\\tmp\\etldocset"); // Set the seeds module property on the source config. sourceConfig.addModuleProperty(seeds); // Create a module property for gathering native file props. ModuleProperty nativeFileProps = new ModuleProperty(); // Set the key for gathering native file properties. nativeFileProps.setKey("gatherNativeFileProperties"); // Set the value to enable gathering native file properties. nativeFileProps.setValues("true"); // Set the nativeFileProps module property on the source config. sourceConfig.addModuleProperty(nativeFileProps); // Create a module property object for expanding archives. ModuleProperty extractArchives = new ModuleProperty(); // Set the key for extracting archive files. extractArchives.setKey("expandArchives"); // Set the value to enable expanding archives. extractArchives.setValues("true"); // Set the extractArchives module property on the source config. sourceConfig.addModuleProperty(extractArchives); // Set the source configuration in the crawl configuration. crawlConfig.setSourceConfig(SourceConfig); // Create the crawl. crawler.createCrawl(crawlConfig);
構成されているクロールからSourceConfigオブジェクトを取得した場合、getModuleId()メソッドをコールしてモジュールIDを取得したり、getModuleProperties()メソッドをコールしてモジュール・プロパティのリストを取得することができます。