How to add custom Lucene analyzer?

Registration of custom analyzers is simple. Just create a java class extending AnalyzerProvider that provides the internal name and implementation of the custom analyzer.
As an example take a look at neo4j/Swedish.java at 3.5 · neo4j/neo4j · GitHub

Note that the @Service.Implementation annotation might not work without some tweaks to your build system. Instead make sure you have a service loader file in place:
META-INF/services/org.neo4j.graphdb.index.fulltext.AnalyzerProvider listing your analyzer provider classes and bundle this with your implementation into a jar file.
That jar file needs to be dropped into neo4j's /plugins folder.

1 Like