Class ScoredDocument.Builder (2.0.0)

public static final class ScoredDocument.Builder extends Document.Builder

A builder of scored documents. This is not thread-safe.

Inheritance

java.lang.Object > Document.Builder > ScoredDocument.Builder

Methods

addExpression(Field expression)

public ScoredDocument.Builder addExpression(Field expression)

Adds the expression to the builder.

Parameter
Name Description
expression Field

the expression field to add

Returns
Type Description
ScoredDocument.Builder

this builder

addScore(double score)

public ScoredDocument.Builder addScore(double score)

Adds the score to the builder.

Parameter
Name Description
score double

the score to add

Returns
Type Description
ScoredDocument.Builder

this builder

build()

public ScoredDocument build()

Builds a valid document. The builder must have set a valid document id, and have a non-empty set of valid fields.

Returns
Type Description
ScoredDocument

the scored document built by this builder

Overrides

setCursor(Cursor cursor)

public ScoredDocument.Builder setCursor(Cursor cursor)

Sets the cursor to the next set of results from search.

Parameter
Name Description
cursor Cursor

the Cursor for the next set of results from search

Returns
Type Description
ScoredDocument.Builder

this builder