ICA IBM Content Analytics with Enterprise Search
FileNet p8搜寻器 插件编写
插件作用,把author字段,拆分然后赋值
例子:
author:"user1,user2,user3,user4"
改成
author:"user1"
author:"user2"
author:"user3"
author:"user4"
import java.util.List;
import com.ibm.ilel.crawler.plugin.Metadata;
import com.ibm.ilel.crawler.plugin.CrawledData;
import com.ibm.ilel.crawler.plugin.CrawlerPlugin;
import com.ibm.ilel.crawler.plugin.CrawlerPluginException;
import com.ibm.ilel.crawler.plugin.metadata.StringMetadata;
public class te extends CrawlerPlugin
{
public te() {
@Override
public CrawledData updateDocument(CrawledData arg0)
throws CrawlerPluginException {
// TODO Auto-generated method stub
List ms= arg0.getMetadataList();
// for(int i=0;i
// if(ms.get(i).getNativeName().equalsIgnoreCase("author")){
// String str = ms.get(i).getString();
// String[] strs = str.split(",");
// for(int j=0;j
// ms.get(i).setString(strs[j]);
// }
// }
// }
String[] strs = null;
for(int i=0;i
if(ms.get(i).getNativeName().equalsIgnoreCase("author")){
String str = ms.get(i).getString();
strs = str.split(",");
ms.remove(i);
}
}
for(int j=0;j
Metadata md = new StringMetadata("author",strs[j]);
ms.add(md);
}
return arg0;
}
public void term() throws CrawlerPluginException {
super.term();
}
public void init() throws CrawlerPluginException {
super.init();
}
}