List of usage examples for org.apache.lucene.analysis.util ClasspathResourceLoader ClasspathResourceLoader
@Deprecated @SuppressForbidden(reason = "Deprecated method uses thread's context classloader, but there for backwards compatibility") public ClasspathResourceLoader()
From source file:org.apache.jackrabbit.oak.plugins.index.lucene.NodeStateAnalyzerFactoryTest.java
License:Apache License
@Test public void nodeStateResourceLoader() throws Exception { byte[] testData = "hello".getBytes(); NodeBuilder nb = EMPTY_NODE.builder(); createFileNode(nb, "foo", testData); NodeStateResourceLoader loader = new NodeStateResourceLoader(nb.getNodeState(), new ClasspathResourceLoader()); assertArrayEquals(testData, IOUtils.toByteArray(loader.openResource("foo"))); }
From source file:org.wltea.analyzer.lucene.SynIKAnalyzer.java
License:Apache License
/** * ???/*from www .j av a2 s .co m*/ */ public void initalSynonmFilter() { argsMap = new HashMap<String, String>(); argsMap.put("expand", "true"); argsMap.put("synonyms", "synonyms.txt"); argsMap.put("autoupdate", "false"); argsMap.put("flushtime", "10"); try { syfilter = new IKSynonymFilterFactory(argsMap); syfilter.inform(new ClasspathResourceLoader()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }