Package com.lucidworks.indexing.api
Interface Document.Field<T>
-
- Type Parameters:
T- Type of field values
- Enclosing interface:
- Document
public static interface Document.Field<T>Representation of single field in document. Fields can be multivalued
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Document.Field<T>add(java.util.Collection<T> values)Add more values to the field.Document.Field<T>add(T value)Add value to the field preserving any previously existing values.java.util.Collection<T>get()Get all field values as immutable collection.TgetFirst()Get first value from the field.java.util.Set<java.lang.String>getHints()Get all hints for this field.java.lang.StringgetName()Get field name.Document.Field<T>hint(java.lang.String... hint)Add hint value to the field.Document.Field<T>map(java.util.function.UnaryOperator<T> mapper)Apply mapping function to each field value.Document.Field<T>multivalued()Set multivalued field hint.Document.Field<T>operation(Operations operation)Set atomic update modifier hint.Document.Field<T>set(java.util.Collection<T> values)Set new field values removing any previously existing values.Document.Field<T>set(T value)Set new field value removing any previously existing values.Document.Field<T>type(Types type)Set type hint.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get field name.- Returns:
- Field name
-
set
Document.Field<T> set(java.util.Collection<T> values)
Set new field values removing any previously existing values.- Parameters:
values- Collection of values to set- Returns:
- This field, with modified list of values
-
add
Document.Field<T> add(java.util.Collection<T> values)
Add more values to the field.- Parameters:
values- List of values to add- Returns:
- This field, with modified list of values
-
get
java.util.Collection<T> get()
Get all field values as immutable collection.- Returns:
- Field values
-
set
Document.Field<T> set(T value)
Set new field value removing any previously existing values.- Parameters:
value- Value to set- Returns:
- This field, with modified list of values
-
add
Document.Field<T> add(T value)
Add value to the field preserving any previously existing values.- Parameters:
value- Value to add- Returns:
- This field, with modified list of values
-
type
Document.Field<T> type(Types type)
Set type hint. This will help Fusion determine Solr field type when saving document to collection.- Parameters:
type- Value to be set on type hint- Returns:
- This field
-
operation
Document.Field<T> operation(Operations operation)
Set atomic update modifier hint. This will tell Fusion what atomic update operation to apply to the field, if any.- Parameters:
operation- Operation modifier value to be set for the field- Returns:
- This field
-
multivalued
Document.Field<T> multivalued()
Set multivalued field hint. This will tell Fusion to use multivalued Solr field type for this field when saving document to collection.- Returns:
- This field
-
getFirst
T getFirst()
Get first value from the field. This is useful for doing manipulations with single valued fields.- Returns:
- First value from the field.
-
map
Document.Field<T> map(java.util.function.UnaryOperator<T> mapper)
Apply mapping function to each field value.- Parameters:
mapper- Mapping function- Returns:
- This field
-
hint
Document.Field<T> hint(java.lang.String... hint)
Add hint value to the field.- Parameters:
hint- Hint value- Returns:
- This field
-
getHints
java.util.Set<java.lang.String> getHints()
Get all hints for this field.- Returns:
- Field hints
-
-