Luke, the wonderful Lucene index viewer, is now hosted under Google code. As a default, it supports using several Lucene Analyzers out of the box. However, I would like to use it to view an index I built using my own custom Analyzer, Let's call it MyAnalyzer. Can you please tell me how to add MyAnalyzer to Luke, along with the default analyzers? Googling and some examination of the lukeall jar gave me no clue.
Thanks zehrer. I am accepting this, as this seems like the way to go. It still does not work for me, but I will take another shot at it.
Yuval F
2010-01-03 10:33:53
If you extend Analyzer it must work, here is the relevant code from luke (v1.0): // populate analyzers try { Class[] an = ClassFinder.getInstantiableSubclasses(Analyzer.class); if (an == null || an.length == 0) { analyzers = defaultAnalyzers; } else { HashSet<Class> uniq = new HashSet<Class>(Arrays.asList(an)); analyzers = (Class[])uniq.toArray(new Class[uniq.size()]); } Object cbType = find("cbType"); populateAnalyzers(cbType); } catch (Exception e) { e.printStackTrace(); }
zehrer
2010-01-04 07:16:39
Now it works. The problems I had stemmed from improper creation of a Jar archive for the custom analyzer. Once I had the proper Jar, including all of the directories and dependencies, and the proper classpath, it does work. Thanks again.
Yuval F
2010-01-04 10:49:15