Lucene Snippets: Index Stats

In Lucene 4.x there is an API to fetch index statistics for specific document’s fields. The following examples shows how to create an index with some random documents and fetch some statistics for a field afterwards .. Lucene Dependencies Just one dependency needed here .. lucene-core. I’ve added the declarations needed for Maven and SBT here .. if you’re using Gradle or Buildr you should’t have a problem to create your build file either.. ...

September 8, 2012 · 3 min · 560 words · Micha Kops

Extending the Confluence Search Index

Developing plugins for the Confluence Wiki a developer sometimes needs to save additional metadata to a page object using Bandana or the ContentPropertyManager. Wouldn’t it be nice if this metadata was available in the built-in Lucene index? That is were the Confluence Extractor Module comes into play.. Overview An extractor allows the developer to add new fields to the lucene search index. Creating a new extractor is quite simple – just implement the interface com.atlassian.bonnie.search.Extractor or bucket.search.lucene.extractor.BaseAttachmentContentExtractor if you want to build a new file extractor. ...

May 23, 2010 · 4 min · 713 words · Micha Kops

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