Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util.search
Class MultiFilter

java.lang.Object
  extended by org.apache.lucene.search.Filter
      extended by com.jivesoftware.util.search.MultiFilter
All Implemented Interfaces:
java.io.Serializable

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

A Filter that logically combines multiple other Filters. An arbitrary number of Filter objects can be added to each MultiFilter. MultiFilters may combine there component filters either by AND'ing them or OR'ing them, i.e., when a Query is executed with a MultiFilter, each Document in the HitList must pass either every or any Filter in the MultiFilter filter list.

For example, consider an AND MultiFilter that is created with a FilterX filter and FilterY filter. When a search is executed with the MultiFilter, in order for Document A to appear in the results, it must pass both the FilterX and FilterY filters. On the other hand, if an OR MultiFilter is created the same filters, Document A will appear in the results if it passes either the FilterX or FilterY filters or both.

If no Filter objects are added to a MultiFilter before it is used in a search, this will have the affect of filtering out all search results.

See Also:
Serialized Form

Nested Class Summary
static class MultiFilter.FilterType
           
 
Constructor Summary
MultiFilter()
          Creates a new MultiFilter.
MultiFilter(int initialCapacity)
          Creates a new MultiFilter with the specified initial capacity.
MultiFilter(int initialCapacity, MultiFilter.FilterType filterType)
          Creates a new MultiFilter with the specified initial capacity.
MultiFilter(MultiFilter.FilterType filterType)
           
 
Method Summary
 void add(org.apache.lucene.search.Filter filter)
          Adds a filter to the MuliFilter filter list.
 java.util.BitSet bits(org.apache.lucene.index.IndexReader reader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiFilter

public MultiFilter()
Creates a new MultiFilter.


MultiFilter

public MultiFilter(MultiFilter.FilterType filterType)

MultiFilter

public MultiFilter(int initialCapacity)
Creates a new MultiFilter with the specified initial capacity. Providing an initial capacity equal to the size of the eventual MultiFilter size provides a slight performance advantage over letting the MultiFilter grow automatically.

Parameters:
initialCapacity - an initial capacity size for the MultiFilter.

MultiFilter

public MultiFilter(int initialCapacity,
                   MultiFilter.FilterType filterType)
Creates a new MultiFilter with the specified initial capacity. Providing an initial capacity equal to the size of the eventual MultiFilter size provides a slight performance advantage over letting the MultiFilter grow automatically.

Parameters:
initialCapacity - an initial capacity size for the MultiFilter.
Method Detail

add

public void add(org.apache.lucene.search.Filter filter)
Adds a filter to the MuliFilter filter list.

Parameters:
filter - a Filter to add to the MultiFilter filter list.

bits

public java.util.BitSet bits(org.apache.lucene.index.IndexReader reader)
                      throws java.io.IOException
Specified by:
bits in class org.apache.lucene.search.Filter
Throws:
java.io.IOException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.