cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Building a custom Lucene analyzer for Neo4j

neo4joe
Node Clone

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: https://lucene.apache.org/core/5_5_0/analyzers-common/org/apache/lucene/analysis/custom/CustomAnalyz...

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

2 REPLIES 2

wergeland
Node Clone

(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.