public class

BitSetAwareDocumentResultScores

extends Object
implements DocumentResultScores
java.lang.Object
   ↳ com.atlassian.confluence.search.contentnames.lucene.BitSetAwareDocumentResultScores

Class Overview

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

Summary

Public Constructors
BitSetAwareDocumentResultScores(BitSet bitSet, DocumentResultScores documentResultScores)
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.search.contentnames.DocumentResultScores

Public Constructors

public BitSetAwareDocumentResultScores (BitSet bitSet, DocumentResultScores documentResultScores)

Public Methods

public 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.

Parameters
block the block to run against each document id and score pair.

public float getScore (int docId)

Retrieve the score for the specified docId.

Parameters
docId the document id
Returns
  • the score for the specified docId

public float incrementScore (int docId, byte increment)

Increase the score for the specified document by the supplied amount.

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

public float multiplyScore (int docId, float factor)

Multiply the score of the specified document by the supplied factor.

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.

public void setScore (int docId, float score)

Override any existing score for the specified document and replace with the new supplied score.

Parameters
docId the document Id to set the score for.
score the new score for this document.