pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.search
Class SitemapNodeUniqueContentFilter

java.lang.Object
  extended by org.apache.lucene.search.Filter
      extended by org.torweg.pulse.util.search.SitemapNodeUniqueContentFilter
All Implemented Interfaces:
java.io.Serializable

public class SitemapNodeUniqueContentFilter
extends org.apache.lucene.search.Filter

a Filter providing unique Contents during full text search.

The actual filtering is heavily influenced by org.apache.lucene.search.DuplicateFilter of the LuceneTM contrib package.

Version:
$Revision: 1415 $
Author:
unknown, Thomas Weber
See Also:
SitemapNode, Serialized Form

Constructor Summary
SitemapNodeUniqueContentFilter()
          default constructor.
 
Method Summary
 org.apache.lucene.search.DocIdSet getDocIdSet(org.apache.lucene.index.IndexReader reader)
          does the actual filtering.
 org.apache.lucene.search.Filter getFilter()
          factory method to create a cachable version of SitemapNodeUniqueContentFilter.
 
Methods inherited from class org.apache.lucene.search.Filter
bits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SitemapNodeUniqueContentFilter

public SitemapNodeUniqueContentFilter()
default constructor.

Method Detail

getFilter

@Factory
public final org.apache.lucene.search.Filter getFilter()
factory method to create a cachable version of SitemapNodeUniqueContentFilter.

Returns:
the cachable filter
See Also:
Factory

getDocIdSet

public final org.apache.lucene.search.DocIdSet getDocIdSet(org.apache.lucene.index.IndexReader reader)
                                                    throws java.io.IOException
does the actual filtering.

It creates a DocIdBitSet which is IndexReader.maxDoc() wide with bits set for all non duplicates.

Overrides:
getDocIdSet in class org.apache.lucene.search.Filter
Parameters:
reader - the index reader
Returns:
a bit set with the results to be included
Throws:
java.io.IOException - on errors accessing the index
See Also:
Filter.getDocIdSet(org.apache.lucene.index.IndexReader)