MarkLogic Connect
MarkLogic Connect Client API Collection
|
A self-advancing result set class. More...
#include <SearchResultSet.hpp>
Public Types | |
typedef SearchResultSetIterator | const_iterator |
Public Member Functions | |
MLCLIENT_API | SearchResultSet (IConnection *conn, SearchDescription *desc) |
Creates a self-advancing result set given the specified search description. More... | |
virtual MLCLIENT_API | ~SearchResultSet ()=default |
Destroys a SearchResultSet and all of its owned resources. | |
MLCLIENT_API SearchResultSetIterator * | begin () const |
Returns the iterator for this result set. More... | |
MLCLIENT_API SearchResultSetIterator * | end () const |
Returns a reference to the end of the iterator for this result set. More... | |
MLCLIENT_API bool | fetch () |
Uses the provided Connection and SearchDescription to perform a request, and initial this object and the list of results. More... | |
MLCLIENT_API std::exception * | getFetchException () |
Returns the exception, if any, encountered by fetch(). nullptr is returned if no exception raised. More... | |
MLCLIENT_API const long | getStart () |
Returns the sequence number of the first search result. More... | |
MLCLIENT_API const long | getTotal () |
Returns the total count of all search results, across all pages. More... | |
MLCLIENT_API const long | getPageLength () |
Returns the number of results returned on each page. More... | |
MLCLIENT_API const std::string & | getSnippetFormat () const |
Returns the snippet format. Could be raw, none, or snippet. More... | |
MLCLIENT_API const std::string & | getQueryResolutionTime () const |
Returns the query resolution time for the last page requested, if available. More... | |
MLCLIENT_API const std::string & | getSnippetResolutionTime () const |
Returns the snippet resolution time for the last page requested, if available. More... | |
MLCLIENT_API const std::string & | getTotalTime () const |
Returns the total time taken for the last page requested, if available. More... | |
MLCLIENT_API const long | getPageCount () const |
Utility function to return the total number of pages in the result set. More... | |
MLCLIENT_API void | setMaxResults (long maxResults) |
Sets the maximum number of results to return. Useful if the maximum is larger than the page size. More... | |
Friends | |
class | SearchResultSetIterator |
A self-advancing result set class.
Sometimes it is useful to advance beyond 1 page of search results in MarkLogic. This class allows this to happen whilst carrying out any additional page requests to the underlying Connection when needed.
A public typedef for the iterator. This prevents recoding if we change the implementation in future.
MLCLIENT_API mlclient::SearchResultSet::SearchResultSet | ( | IConnection * | conn, |
SearchDescription * | desc | ||
) |
Creates a self-advancing result set given the specified search description.
conn | The Connection instance pointer |
desc | The Search Description to use for requests - will be owned by this class |
MLCLIENT_API SearchResultSetIterator* mlclient::SearchResultSet::begin | ( | ) | const |
Returns the iterator for this result set.
MLCLIENT_API SearchResultSetIterator* mlclient::SearchResultSet::end | ( | ) | const |
Returns a reference to the end of the iterator for this result set.
MLCLIENT_API bool mlclient::SearchResultSet::fetch | ( | ) |
Uses the provided Connection and SearchDescription to perform a request, and initial this object and the list of results.
MLCLIENT_API std::exception* mlclient::SearchResultSet::getFetchException | ( | ) |
Returns the exception, if any, encountered by fetch(). nullptr is returned if no exception raised.
MLCLIENT_API const long mlclient::SearchResultSet::getPageCount | ( | ) | const |
Utility function to return the total number of pages in the result set.
MLCLIENT_API const long mlclient::SearchResultSet::getPageLength | ( | ) |
Returns the number of results returned on each page.
MLCLIENT_API const std::string& mlclient::SearchResultSet::getQueryResolutionTime | ( | ) | const |
Returns the query resolution time for the last page requested, if available.
Defaults to zero. Uses xsd:duration string format as per the REST API
MLCLIENT_API const std::string& mlclient::SearchResultSet::getSnippetFormat | ( | ) | const |
Returns the snippet format. Could be raw, none, or snippet.
MLCLIENT_API const std::string& mlclient::SearchResultSet::getSnippetResolutionTime | ( | ) | const |
Returns the snippet resolution time for the last page requested, if available.
Defaults to zero. Uses xsd:duration string format as per the REST API
MLCLIENT_API const long mlclient::SearchResultSet::getStart | ( | ) |
Returns the sequence number of the first search result.
MLCLIENT_API const long mlclient::SearchResultSet::getTotal | ( | ) |
Returns the total count of all search results, across all pages.
MLCLIENT_API const std::string& mlclient::SearchResultSet::getTotalTime | ( | ) | const |
Returns the total time taken for the last page requested, if available.
Defaults to zero. Uses xsd:duration string format as per the REST API
MLCLIENT_API void mlclient::SearchResultSet::setMaxResults | ( | long | maxResults | ) |
Sets the maximum number of results to return. Useful if the maximum is larger than the page size.