How can I set a custom analyzer?
See original GitHub issueGiven that the current method signature is described as follow :
indexAnalyzer: String = getOrElseEn(IndexAnalyzerConfigName),
queryAnalyzer: String = getOrElseEn(QueryAnalyzerConfigName),
It would be great to be able to provide the instance of the analyzer instead of a String. This would open the door to create custom analyzers and use them with LuceneRDD.
I tried to create a package org.apache.lucene.analysis
and a class "StandardCustomStopWords"
which extends Analyzer and passed indexAnalyzer = "StandardCustomStopWords"
but that does not seem to work. It also did not print any type of warning , so we might need to consider adding this also
I am guessing that compiling a custom lucene build is a solution , but it is not very convenient or practical.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Create a custom analyzer | Elasticsearch Guide [8.5] | Elastic
Analyzer type. Accepts built-in analyzer types. For custom analyzers, use custom or omit this parameter. tokenizer.
Read more >Tutorial: create a custom analyzer - Azure Cognitive Search
Learn how to build a custom analyzer to improve the quality of search results in Azure Cognitive Search.
Read more >Elasticsearch Custom Analyzer - MindMajix
This is a customized option to create Analyzers of our choice that meets our requirements. These can be created with a Tokenizer and...
Read more >Custom analyzer building in Elasticsearch | by Arun Mohan
This will create the index with the custom analyzer, named “ custom_analyzer_01 ”. This mapping is explained in detail, with each section ...
Read more >Elasticsearch adding custom analyzer to all fields
In the index settings, define an analyzer named default which defines the analyzer when a field mapping does not define an analyzer.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yeikel , pushed the feature in version
0.3.7-SNAPSHOT
. You can try it out and let me know if there are any issues.Yes, analyzers in Lucene are not serializable.