org.apache.solr.search
Class CursorMark

java.lang.Object
  extended by org.apache.solr.search.CursorMark

public final class CursorMark
extends Object

An object that encapsulates the basic information about the current Mark Point of a "Cursor" based request. CursorMark objects track the sort values of the last document returned to a user, so that SolrIndexSearcher can then be asked to find all documents "after" the values represented by this CursorMark.


Constructor Summary
CursorMark(IndexSchema schema, SortSpec sortSpec)
          Generates an empty CursorMark bound for use with the specified schema and SortSpec.
 
Method Summary
 CursorMark createNext(List<Object> nextSortValues)
          Generates an new CursorMark bound for use with the same SortSpec as the current CursorMark but using the new SortValues.
 FieldDoc getSearchAfterFieldDoc()
          Returns a synthetically constructed FieldDoc whose FieldDoc.fields match the values of this object.
 String getSerializedTotem()
          Generates a Base64 encoded serialized representation of the sort values encapsulated by this object, for use in cursor requests.
 SortSpec getSortSpec()
          Returns the SortSpec used by this object.
 List<Object> getSortValues()
          Returns a copy of the (raw, unmarshalled) sort values used by this object, or null if first page of docs should be returned (ie: no sort after)
 void parseSerializedTotem(String serialized)
          Parses the serialized version of a CursorMark from a client (which must conform to the existing sortSpec) and populates this object.
 void setSortValues(List<Object> input)
          Sets the (raw, unmarshalled) sort values (which must conform to the existing sortSpec) to populate this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CursorMark

public CursorMark(IndexSchema schema,
                  SortSpec sortSpec)
Generates an empty CursorMark bound for use with the specified schema and SortSpec.

Parameters:
schema - used for basic validation
sortSpec - bound to this totem (un)marshalling serialized values
Method Detail

createNext

public CursorMark createNext(List<Object> nextSortValues)
Generates an new CursorMark bound for use with the same SortSpec as the current CursorMark but using the new SortValues.


setSortValues

public void setSortValues(List<Object> input)
Sets the (raw, unmarshalled) sort values (which must conform to the existing sortSpec) to populate this object. If null, then there is nothing to "search after" and the "first page" of results should be returned.


getSortValues

public List<Object> getSortValues()
Returns a copy of the (raw, unmarshalled) sort values used by this object, or null if first page of docs should be returned (ie: no sort after)


getSortSpec

public SortSpec getSortSpec()
Returns the SortSpec used by this object.


parseSerializedTotem

public void parseSerializedTotem(String serialized)
Parses the serialized version of a CursorMark from a client (which must conform to the existing sortSpec) and populates this object.

See Also:
getSerializedTotem()

getSerializedTotem

public String getSerializedTotem()
Generates a Base64 encoded serialized representation of the sort values encapsulated by this object, for use in cursor requests.

See Also:
parseSerializedTotem(java.lang.String)

getSearchAfterFieldDoc

public FieldDoc getSearchAfterFieldDoc()
Returns a synthetically constructed FieldDoc whose FieldDoc.fields match the values of this object.

Important Notes:

Returns:
a FieldDoc to "search after" or null if the initial page of results is requested.


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.