Building a custom Lucene analyzer for Neo4j

I wish to use Neo4j’s new built-in full-text search capability to search documents that will contain a mix of Norwegian and English (sometimes either, sometimes both). I understand the indexer is stock Lucene 5.5.0, and with that I can choose to use it with a provided Norwegian analyzer or English analyzer, not both simultaneously.

I would like to experiment with building a hybrid Norwegian/English analyzer. And ideally I’d like to use this fit-for-purpose convenience class for building a custom Lucene analyzer: CustomAnalyzer (Lucene 5.5.0 API)

Would this class be compatible with the method Stefan Armbruster described here? How to add custom Lucene analyzer?

(Copied my response from the original thread were you asked the same question.)

You can use that analyzer, but you still need to

  1. Configure your CustomAnalyzer instance.
  2. Register it in Neo4j.

Both can be accomplished with a single class CustomAnalyzerProvider that extends AnalyzerProvider .

Okay, I will use only CustomAnalyzerProvider that comes with Neo4j.