question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I set a custom analyzer?

See original GitHub issue

Given 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:closed
  • Created 5 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
zouziascommented, Mar 18, 2019

@yeikel , pushed the feature in version 0.3.7-SNAPSHOT. You can try it out and let me know if there are any issues.

1reaction
zouziascommented, Mar 15, 2019

Yes, analyzers in Lucene are not serializable.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found