How to get currently used analyzer?


(Sam-4) #1

Hi

Is there is any java classes that help to get the name of analyzer
which is currently used.by default it use the default analyzer,if try
to explicitly define custom analyzer,there is any way i can make sure
which analyzer being used.

Thanks


(Sam-4) #2
            Index index = new Index(indexName);               

AnalysisService analysisService = new AnalysisService(index);
NamedAnalyzer defaultIndexAnalyzer =
analysisService.defaultIndexAnalyzer();
System.out.println("default index
analyzer::"+defaultIndexAnalyzer.name());
NamedAnalyzer defaultSearchAnalyzer =
analysisService.defaultSearchAnalyzer();
System.out.println("default search
analyzer::"+defaultSearchAnalyzer.name());

On Jan 16, 5:36 pm, sam mishra.sam...@gmail.com wrote:

Hi

Is there is any java classes that help to get the name of analyzer
which is currently used.by default it use the default analyzer,if try
to explicitly define custom analyzer,there is any way i can make sure
which analyzer being used.

Thanks


(Shay Banon) #3

You can use get settings API for an index, if you explicitly specified it.
If not, its the standard analyzer.

On Mon, Jan 16, 2012 at 2:36 PM, sam mishra.sameek@gmail.com wrote:

Hi

Is there is any java classes that help to get the name of analyzer
which is currently used.by default it use the default analyzer,if try
to explicitly define custom analyzer,there is any way i can make sure
which analyzer being used.

Thanks


(system) #4