Package com.lucidworks.querying.api
Interface Document
public interface Document
A document in the query
QueryResponse.
Documents in the query's result set may be accessed by calling
QueryRequestResponse.getQueryResponse().QueryResponse.getDocuments()-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresentation of single field in document. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsField(String field) Whether the document contains the given field.Retrieve from the document the given field.intvoidremoveField(String field) Remove the given field from the document.Set the given field with the given value on the document.
-
Method Details
-
getNumberOfFields
int getNumberOfFields()- Returns:
- the number of fields in the document.
-
getFields
Set<Document.Field<Object>> getFields()- Returns:
- a set of fields in the document.
-
containsField
Whether the document contains the given field.- Parameters:
field- the name of the field- Returns:
- true if the document contains the given field
-
getField
Retrieve from the document the given field.- Parameters:
field- the name of the field to retrieve- Returns:
- the retrieved field if present, otherwise an empty
Optional
-
setField
Set the given field with the given value on the document. This will override any previously existing field on the the document that had the same name.- Parameters:
field- the name of the fieldvalue- the value of the field- Returns:
- the previously set field if any, otherwise null
-
removeField
Remove the given field from the document.- Parameters:
field- the name of the field.
-