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

Lucene Snippets: Faceting Search

The latest snippet from my Lucene examples demonstrates how to achieve a facet search using the Lucene 4.0 API and how easy it is to define multiple category paths to aggregate search results for different possible facets. In the following example we’re indexing some books as a classical example and create multiple category paths for author, publication date and category afterwards .. Lucene Dependencies We simply need two dependencies here .. lucene-core of course and in addition the lucene-facet library .. 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 transfer the information needed ;) ...

August 28, 2012 · 4 min · 837 words · Micha Kops

Neo4j Graph Database Tutorial: How to build a Route Planner and other Examples

Often in the life of developer’s life there is a scenario where using a relational database tends to get complicated or sometimes even slow – especially when there are fragments with multiple relationships or multiple connections present. This often leads to complex database queries or desperate software engineers trying to handle those problems with their ORM framework. A possible solution might be to switch from a relational database to a graph database – and – neo4j is our tool of choice here. In the following tutorial we’re going to implement several examples to demonstrate the strengths of a graph database .. from a route planner to a social graph. ...

January 20, 2012 · 12 min · 2397 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