Package com.lucidworks.indexing.api
Interface Document
-
public interface Document
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceDocument.Field<T>Representation of single field in document.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFieldValue(java.lang.String fieldName, java.lang.Object value)Add new value to the list of existing field values.java.util.Set<Document.Field<java.lang.Object>>allFields()Get all fields document contains, including those that are reserved for internal use.voiddelete()Mark document for deletion.Document.Field<java.lang.Object>field(java.lang.String fieldName)Get or create document field by name.<T> Document.Field<T>field(java.lang.String fieldName, java.lang.Class<T> fieldClass)Get or create document of specific type field by name.java.util.Set<Document.Field<java.lang.Object>>fields()Get all fields document contains, excluding those that are reserved for internal usejava.util.Map<java.lang.String,java.util.List<java.lang.Object>>getFieldsAsMap()Get document fields as map.java.util.List<java.lang.Object>getFieldValues(java.lang.String fieldName)Get all field values.java.lang.StringgetId()Get document unique identifier.booleanisDelete()Check if document is marked for deletion.voidsetFieldValues(java.lang.String fieldName, java.util.List<?> values)Sets list of values to the field, removing any previously existing values.
-
-
-
Method Detail
-
getId
java.lang.String getId()
Get document unique identifier.- Returns:
- Identifier assigned to the document or null if identifier hasn't been assigned yet.
-
getFieldsAsMap
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getFieldsAsMap()
Get document fields as map.- Returns:
- Map of fields
-
getFieldValues
java.util.List<java.lang.Object> getFieldValues(java.lang.String fieldName)
Get all field values.- Parameters:
fieldName- Name of the field- Returns:
- List of assigned values
-
setFieldValues
void setFieldValues(java.lang.String fieldName, java.util.List<?> values)Sets list of values to the field, removing any previously existing values.- Parameters:
fieldName- Name of the fieldvalues- List of values to set
-
addFieldValue
void addFieldValue(java.lang.String fieldName, java.lang.Object value)Add new value to the list of existing field values.- Parameters:
fieldName- Name of the fieldvalue- Value to add
-
delete
void delete()
Mark document for deletion. Calling this method will instruct Fusion to remove current document from index.
-
isDelete
boolean isDelete()
Check if document is marked for deletion.- Returns:
trueif document was marked for deletion by the preceding pipeline stages.
-
field
Document.Field<java.lang.Object> field(java.lang.String fieldName)
Get or create document field by name.- Parameters:
fieldName- Name of the field- Returns:
- Document field
-
field
<T> Document.Field<T> field(java.lang.String fieldName, java.lang.Class<T> fieldClass)
Get or create document of specific type field by name.- Type Parameters:
T- The type of field- Parameters:
fieldName- Name of the fieldfieldClass- Type of the field- Returns:
- Document field
-
fields
java.util.Set<Document.Field<java.lang.Object>> fields()
Get all fields document contains, excluding those that are reserved for internal use- Returns:
- Set of document fields
-
allFields
java.util.Set<Document.Field<java.lang.Object>> allFields()
Get all fields document contains, including those that are reserved for internal use.- Returns:
- Set of document fields
-
-