Home > Articles > Programming > Java

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

John Ferguson Smart
  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Close WindowJohn Ferguson Smart

John Ferguson Smart 

Learn more…

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

 Big Nerd RanchAsk Big Nerd Ranch: Blocks in Objective-C
By Big Nerd Ranch on June 24, 2010 No Comments

Adam Preble answers a question about blocks.

Danny KalevYves Smith: Suspicions that The Fed is manipulating Wall Street
By Danny Kalev on May 24, 2010 No Comments

Yves Smith, the nom de plume of the creator of Naked Capitalism and one of the most savvy and respected members of the blogosphere. In professional life Yves is known as Susan Webber. Yves recently gave an interview to an Israeli financial newspaper in which she claims that a federal team unofficially called "the plunge protection team" is manipulating the stocks on Wall Street.

 Big Nerd RanchAsk Big Nerd Ranch: Rotating an iPhone View Around a Point
By Big Nerd Ranch on May 20, 2010 No Comments

Brian Hardy answers a question about view rotation.

Sample code for this article is available in the Big Nerd Ranch github repository. The sample application demonstrates several techniques illustrated here, and works on iPhone or iPad.

Q. On iPhone OS, how can I rotate a view around an arbitrary point?

A. By default, views in Cocoa Touch (and Cocoa) are configured to rotate around their center point. While this is commonly useful (think of a UIActivityIndicatorView), often you will want to use a point other than the center. There are (at least) two ways of doing this. You can change the anchorPoint property of the view's layer. Alternatively, you can wrap the view in a superview, with the superview's center located at the point you want to rotate around. In either case, the mechanism for rotation is the same. Both techniques are discussed here.

See All Related Blogs

Informit Network