@Test public void analyzerByComposition_TokenFilter() throws Exception{ NodeBuilder nb = EMPTY_NODE.builder(); nb.child(ANL_TOKENIZER).setProperty(ANL_NAME, "whitespace"); NodeBuilder filters = nb.child(ANL_FILTERS); filters.setProperty(OAK_CHILD_ORDER, ImmutableList.of("stop", "LowerCase"),NAMES); filters.child("LowerCase").setProperty(ANL_NAME, "LowerCase"); filters.child("LowerCase").setProperty(JCR_PRIMARYTYPE, "nt:unstructured"); filters.child("stop").setProperty(ANL_LUCENE_MATCH_VERSION, Version.LUCENE_31.toString()); TokenizerChain analyzer = (TokenizerChain) factory.createInstance(nb.getNodeState()); assertEquals(2, analyzer.getFilters().length); assertEquals(StopFilterFactory.class.getName(), analyzer.getFilters()[0].getClassArg()); assertEquals(LowerCaseFilterFactory.class.getName(), analyzer.getFilters()[1].getClassArg()); assertTrue(analyzer.getFilters()[0].isExplicitLuceneMatchVersion()); }
public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state); }
NodeStateAnalyzerFactory { public Analyzer createInstance(NodeState state) { if (state.hasProperty(LuceneIndexConstants.ANL_CLASS)){ return createAnalyzerViaReflection(state); } return composeAnalyzer(state); } NodeStateAnalyzerFactory(Version defaultVersion);   NodeStateAnalyzerFactory(ResourceLoader defaultLoader, Version defaultVersion); Analyzer createInstance(NodeState state);  }