public static class Document.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Document.Builder
|
addField
(
Field.Builder
builder)
Adds the field builder to the document builder.
|
Document.Builder
|
addField
(
Field
field)
Adds the field to the builder.
|
Document
|
build
()
Builds a valid document.
|
Document.Builder
|
setId
(java.lang.String documentId)
Set the document id to a unique valid value.
|
Document.Builder
|
setLocale
(java.util.Locale locale)
Sets the
Locale
the document is written in.
|
Document.Builder
|
setRank
(int rank)
Sets the rank of this document, which determines the order of documents
returned by search, if no sorting or scoring is given.
|
public Document.Builder setId(java.lang.String documentId)
documentId
- the unique id for the document to be built
java.lang.IllegalArgumentException
- if documentId is not valid
public Document.Builder addField(Field.Builder builder)
builder
- the builder of the field to add
public Document.Builder addField(Field field)
field
- the field to add
java.lang.IllegalArgumentException
- if the field is invalid
public Document.Builder setLocale(java.util.Locale locale)
Locale
the document is written in.
locale
- the
Locale
the document is written in
public Document.Builder setRank(int rank)
rank
- the rank of this document
public Document build()
java.lang.IllegalArgumentException
- if the document built is not valid