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
NameDescription
expressionField

the expression field to add

Returns
TypeDescription
ScoredDocument.Builder

this builder

addScore(double score)

public ScoredDocument.Builder addScore(double score)

Adds the score to the builder.

Parameter
NameDescription
scoredouble

the score to add

Returns
TypeDescription
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
TypeDescription
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
NameDescription
cursorCursor

the Cursor for the next set of results from search

Returns
TypeDescription
ScoredDocument.Builder

this builder