public static class Document.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Document.Builder |
addFacet(Facet facet)
Adds a
Facet to this builder. |
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 builtjava.lang.IllegalArgumentException
- if documentId is not validpublic Document.Builder addField(Field.Builder builder)
builder
- the builder of the field to addpublic Document.Builder addField(Field field)
field
- the field to addjava.lang.IllegalArgumentException
- if the field is invalidpublic Document.Builder addFacet(Facet facet)
Facet
to this builder.facet
- the facet to addpublic Document.Builder setLocale(java.util.Locale locale)
Locale
the document is written in.locale
- the Locale
the document is written inpublic Document.Builder setRank(int rank)
rank
- the rank of this documentpublic Document build()
java.lang.IllegalArgumentException
- if the document built is not valid