public interface

DocumentResultScores

com.atlassian.confluence.search.contentnames.DocumentResultScores
Known Indirect Subclasses

Class Overview

Interface for storing, incrementing and iterating over document scores. Each document id is associated with one document score.

Summary

Nested Classes
interface DocumentResultScores.Block Callback interface to provide clients with the ability to run custom code against all document and score pairs maintained by this class. 
Public Methods
abstract 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.
abstract float getScore(int docId)
Retrieve the score for the specified docId.
abstract float incrementScore(int docId, byte increment)
Increase the score for the specified document by the supplied amount.
abstract float multiplyScore(int docId, float factor)
Multiply the score of the specified document by the supplied factor.
abstract void setScore(int docId, float score)
Override any existing score for the specified document and replace with the new supplied score.

Public Methods

public abstract 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 abstract float getScore (int docId)

Retrieve the score for the specified docId.

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

public abstract 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
Throws
IllegalArgumentException if increment is less than or equal to zero

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