Package com.attivio.sdk.search
Class SearchDocumentList
- java.lang.Object
-
- com.attivio.sdk.search.SearchDocumentList
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Iterable<SearchDocument>
public class SearchDocumentList extends java.lang.Object implements java.lang.Iterable<SearchDocument>, java.io.Externalizable
A list of SearchDocuments returned for a query.The size of the list will be less than or equal to the number of rows requested via
QueryRequest.setRows(long).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SearchDocumentList()The default constructorSearchDocumentList(int initialSize)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SearchDocument value)voidclear()booleancontainsDocument(java.lang.String docID)Tells whether this document list contains a given document based on document ID.booleanequals(java.lang.Object other)voidforEach(java.util.function.Consumer<? super SearchDocument> consumer)SearchDocumentget(int index)SearchDocumentgetDocument(java.lang.String id)Gets a document from this list by ID.floatgetMaxScore()Get the maximum score across all matching documents.longgetNumberFound()longgetOffset()Get the offset that into the overall result set for the first document in this SearchDocumentList.inthashCode()java.util.Iterator<SearchDocument>iterator()voidreadExternal(java.io.ObjectInput in)voidsetMaxScore(float value)voidsetNumberFound(long nf)voidsetOffset(long value)Set the offset that into the overall result set for the first document in this SearchDocumentList.intsize()java.lang.StringtoString()voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
getOffset
public long getOffset()
Get the offset that into the overall result set for the first document in this SearchDocumentList.
-
setOffset
public void setOffset(long value)
Set the offset that into the overall result set for the first document in this SearchDocumentList.
-
getNumberFound
public long getNumberFound()
-
setNumberFound
public void setNumberFound(long nf)
-
setMaxScore
public void setMaxScore(float value)
-
size
public int size()
-
get
public SearchDocument get(int index)
-
iterator
public java.util.Iterator<SearchDocument> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<SearchDocument>
-
forEach
public void forEach(java.util.function.Consumer<? super SearchDocument> consumer)
- Specified by:
forEachin interfacejava.lang.Iterable<SearchDocument>
-
add
public void add(SearchDocument value)
-
clear
public void clear()
-
getMaxScore
public float getMaxScore()
Get the maximum score across all matching documents.NOTE: this will be 0.0 if the result is not orderd by score and document scores are not requested. Adding
FieldNames.SCOREfield toQueryRequestwill force computation of max score.
-
containsDocument
public boolean containsDocument(java.lang.String docID)
Tells whether this document list contains a given document based on document ID.- Parameters:
docID- the document ID- Returns:
- true if the list contains a document with the specified ID
-
getDocument
public SearchDocument getDocument(java.lang.String id)
Gets a document from this list by ID.- Parameters:
id- the ID to look for- Returns:
- the document or null if not in this list
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
-