How to build a quick Lucene Search

Helo – today I wanted to post a small tutorial for a small index and search operation using the Lucene indexer and Maven for the project setup. Setup Create an empty Maven sample project using the Eclipse Maven Plugin or use the following console command: mvn archetype:create -DgroupId=com.hascode.demo.search -DartifactId=lucene-sample Here is my pom.xml there are some dependencies for Lucene defined: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.hascode.demo.search</groupId> <artifactId>lucene-sample</artifactId> <version>0.0.1-SNAPSHOT</version> <name>My Lucene Search Sample</name> <description>Lucene Search Sample</description> <dependencies> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>2.4.1</version> </dependency> <dependency> <groupId>lucene</groupId> <artifactId>lucene</artifactId> <version>1.4.3</version> </dependency> </dependencies> </project> ...

March 25, 2010 · 3 min · 540 words · Micha Kops