Home > Articles > Programming > Java

Lucene: A Tutorial Introduction to Full-Text Indexing in Java

John Ferguson Smart
  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Thinking in Java, 4th Edition

Like this article? We recommend
Thinking in Java, 4th Edition

John Smart provides a quick intro to Lucene, a powerful and elegant library for full-text indexing and searching in Java, with which you can add rich full-text search functionality to your Java web application.

Lucene is a powerful and elegant library for full-text indexing and searching in Java. In this article, we go through some Lucene basics, by adding simple yet powerful full-text index and search functions to a typical J2EE web application.

Full-Text Searching

Nowadays, any modern web site worth its salt is considered to need a "Google-like" search function. Complex multi-criteria search screens are often perceived by users as being too complex, and are in fact rarely used. Users want to be able to just type the word(s) they’re seeking and have the computer do the rest. This explains the growing popularity of search engines such as those of Yahoo! and Google and, more recently, tools such as Google Desktop.

If you need to add this sort of rich full-text search functionality to your Java web application, look no further! Lucene is an extremely rich and powerful full-text search API written in Java. You can use Lucene to provide consistent full-text indexing across both database objects and documents in various formats (Microsoft Office documents, PDF, HTML, text, and so on).

In this article, we’ll go through the basics of using Lucene to add full-text search functionality to a fairly typical J2EE application—an online accommodation database. The main business object is the Hotel class. In this tutorial, a Hotel has a unique identifier, a name, a city, and a description.

  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Jennifer  BortelWin FREE iPhone Developer Books and Videos- Introducing @InformIT Giveaways
By Jennifer Bortel on February 5, 2010 No Comments

Apples’s recent iPad announcement made our hearts flutter so we couldn’t resist making an announcement of our own!

Today marks the first ever @InformIT Giveaway!

We’ll regularly post a video like this one profiling spectacular prizes we’re giving away—from books and videos to T-shirts and other exciting stuff. Check out the video below to see the giveaways for today, and then scroll down for more prize details and instructions on how to win them!

Dustin Sullivan"Every OSX developer should have this book on their desk."
By Dustin Sullivan on February 1, 2010 No Comments

That was the sentence Mike Riley ended his recent Dr Dobb's CodeTalk review of Cocoa Programming Developer's Handbook with.

David ChisnallCocoa Tip of the Day, 1/29/10
By David Chisnall on January 29, 2010 No Comments

Don't ignore old versions of OS X.

See All Related Blogs

Informit Network