Lucene - Analysis-Simple Analyzer - Lucene

What is Lucene Simple Analyzer?

This analyzer splits the text in a document based on non-letter characters and then puts them in lowercase.

Class Declaration

Following is the declaration for the org.apache.lucene.analysis.SimpleAnalyzer class −

Class Constructors

The following table shows the different class constructors −


Constructor & Description



Deprecated. Use SimpleAnalyzer(Version) instead.


SimpleAnalyzer(Version matchVersion)

Creates a new SimpleAnalyzer.

Class Methods

The following table shows the different class methods −

S.No. Method & Description
protected Reusable Analyzer Base. Token Stream Components create Components (String field Name, Reader reader)
Creates a new ReusableAnalyzerBase.TokenStreamComponents instance for this analyzer.

Methods Inherited

This class inherits methods from the following classes −

  • org.apache.lucene.analysis.ReusableAnalyzerBase
  • org.apache.lucene.analysis.Analyzer
  • java.lang.Object


Example Application

Let us create a test Lucene application to test search using BooleanQuery.




Create a project with a nameLuceneFirstApplicationunder apackagecom.wisdomjobs.luceneas explained in theLucene - First Applicationchapter. You can also use the project created inLucene - First Applicationchapter as such for this chapter to understand searching process.


CreateLuceneConstants.javaas explained in theLucene - First Applicationchapter. Keep rest of the files unchanged.


CreateLuceneTester.javaas mentioned below.


Clean and Build the application to make sure business logic is working as per the requirements.

This class is used to provide various constants to be used across the sample application.

This class is used to test the searching capability of the Lucene library.

Running the Program

Once you are done with the creation of the source, you can proceed by compiling and running your program. To do this, keep the LuceneTester.Java file tab active and use either the Run option available in the Eclipse IDE or use Ctrl + F11 to compile and run your LuceneTesterapplication. If your application runs successfully, it will print the following message in Eclipse IDE's console –

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Lucene Topics