tags:

views:

269

answers:

1

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.

+1  A: 

Just put the jar with your custom analyzer in the classpath.

zehrer
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
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
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