## org.apache.lucene.sandbox.queries
Class DuplicateFilter

    java.lang.Object
      org.apache.lucene.search.Filter
          org.apache.lucene.sandbox.queries.DuplicateFilter

    public class DuplicateFilter

extends Filter

Filter to remove duplicate values from search results.

WARNING: for this to work correctly, you may have to wrap your reader as it cannot current deduplicate across different index segments.

See Also:
  `SlowCompositeReaderWrapper`

Nested Class Summary
`static class` `DuplicateFilter.KeepMode` KeepMode determines which document id to consider as the master, all others being identified as duplicates.
`static class` `DuplicateFilter.ProcessingMode` "Full" processing mode starts by setting all bits to false and only setting bits for documents that contain the given field and are identified as none-duplicates.

Constructor Summary
`DuplicateFilter(String fieldName)`
`DuplicateFilter(String fieldName, DuplicateFilter.KeepMode keepMode, DuplicateFilter.ProcessingMode processingMode)`

Method Summary
`boolean` `equals(Object obj)`
`DocIdSet` `getDocIdSet(AtomicReaderContext context, Bits acceptDocs)`
`String` `getFieldName()`
`DuplicateFilter.KeepMode` `getKeepMode()`
`DuplicateFilter.ProcessingMode` `getProcessingMode()`
`int` `hashCode()`
`void` `setFieldName(String fieldName)`
`void` `setKeepMode(DuplicateFilter.KeepMode keepMode)`
`void` `setProcessingMode(DuplicateFilter.ProcessingMode processingMode)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DuplicateFilter

    public DuplicateFilter(String fieldName)

### DuplicateFilter

    public DuplicateFilter(String fieldName,
                           DuplicateFilter.KeepMode keepMode,
                           DuplicateFilter.ProcessingMode processingMode)

Method Detail

### getDocIdSet

    public DocIdSet getDocIdSet(AtomicReaderContext context,
                                Bits acceptDocs)
                         throws IOException

  Specified by:
    `getDocIdSet` in class `Filter`
  Throws:
    `IOException`

### getFieldName

    public String getFieldName()

### setFieldName

    public void setFieldName(String fieldName)

### getKeepMode

    public DuplicateFilter.KeepMode getKeepMode()

### setKeepMode

    public void setKeepMode(DuplicateFilter.KeepMode keepMode)

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### getProcessingMode

    public DuplicateFilter.ProcessingMode getProcessingMode()

### setProcessingMode

    public void setProcessingMode(DuplicateFilter.ProcessingMode processingMode)

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.