Building a custom Lucene analyzer for Neo4j
‎02-16-2019 01:41 PM
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?
- Labels:
-
Operations
‎02-18-2019 12:52 AM
(Copied my response from the original thread were you asked the same question.)
You can use that analyzer, but you still need to
- Configure your CustomAnalyzer instance.
- Register it in Neo4j.
Both can be accomplished with a single class CustomAnalyzerProvider
that extends AnalyzerProvider
.
‎02-18-2019 06:35 AM
Okay, I will use only CustomAnalyzerProvider that comes with Neo4j.