com.atlassian.confluence.search.contentnames.lucene
Class OpenBitSetAwareDocumentResultScores

java.lang.Object
  extended by com.atlassian.confluence.search.contentnames.lucene.OpenBitSetAwareDocumentResultScores
All Implemented Interfaces:
DocumentResultScores

public class OpenBitSetAwareDocumentResultScores
extends java.lang.Object
implements DocumentResultScores

Wrapper class that ensures that only documents that pass the specified bitSet are exposed.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.search.contentnames.DocumentResultScores
DocumentResultScores.Block
 
Constructor Summary
OpenBitSetAwareDocumentResultScores(org.apache.lucene.util.OpenBitSet openBitSet, DocumentResultScores documentResultScores)
           
 
Method Summary
 void each(DocumentResultScores.Block block)
          Iterates through all docId and score pairs where the score is greater than zero and then executes the block against each pair.
 float getScore(int docId)
          Retrieve the score for the specified docId.
 float incrementScore(int docId, byte increment)
          Increase the score for the specified document by the supplied amount.
 float multiplyScore(int docId, float factor)
          Multiply the score of the specified document by the supplied factor.
 void setScore(int docId, float score)
          Override any existing score for the specified document and replace with the new supplied score.
 long size()
          Returns the number of scores.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenBitSetAwareDocumentResultScores

public OpenBitSetAwareDocumentResultScores(org.apache.lucene.util.OpenBitSet openBitSet,
                                           DocumentResultScores documentResultScores)
Method Detail

incrementScore

public float incrementScore(int docId,
                            byte increment)
Description copied from interface: DocumentResultScores
Increase the score for the specified document by the supplied amount.

Specified by:
incrementScore in interface DocumentResultScores
Parameters:
docId - the document Id
increment - the amount to increase score by (must be greater than zero)
Returns:
the new total score for the document

multiplyScore

public float multiplyScore(int docId,
                           float factor)
Description copied from interface: DocumentResultScores
Multiply the score of the specified document by the supplied factor.

Specified by:
multiplyScore in interface DocumentResultScores
Parameters:
docId - the document Id to change the score of
factor - the factor to multiple the document's current score by.
Returns:
the new score for the document.

getScore

public float getScore(int docId)
Description copied from interface: DocumentResultScores
Retrieve the score for the specified docId.

Specified by:
getScore in interface DocumentResultScores
Parameters:
docId - the document id
Returns:
the score for the specified docId

setScore

public void setScore(int docId,
                     float score)
Description copied from interface: DocumentResultScores
Override any existing score for the specified document and replace with the new supplied score.

Specified by:
setScore in interface DocumentResultScores
Parameters:
docId - the document Id to set the score for.
score - the new score for this document.

each

public void each(DocumentResultScores.Block block)
Description copied from interface: DocumentResultScores
Iterates through all docId and score pairs where the score is greater than zero and then executes the block against each pair.

Specified by:
each in interface DocumentResultScores
Parameters:
block - the block to run against each document id and score pair.

size

public long size()
Description copied from interface: DocumentResultScores
Returns the number of scores.

Specified by:
size in interface DocumentResultScores


Copyright © 2003-2014 Atlassian. All Rights Reserved.