MarkLogic Connect
MarkLogic Connect Client API Collection
|
A POD class representing input to the POST of /v1/search - i.e. all search configuration. More...
#include <SearchDescription.hpp>
Public Member Functions | |
MLCLIENT_API | SearchDescription () |
Default Constructor. | |
MLCLIENT_API | SearchDescription (const SearchDescription &desc) |
virtual MLCLIENT_API | ~SearchDescription () |
Default destructor. More... | |
MLCLIENT_API void | setOptions (ITextDocumentContent &options) |
Set the search options content. More... | |
MLCLIENT_API const ITextDocumentContent & | getOptions () const |
Returns the options as a document. More... | |
MLCLIENT_API void | setQuery (ITextDocumentContent &query) |
Sets the complex query using an XML or JSON IDocumentContent instance. More... | |
MLCLIENT_API const ITextDocumentContent & | getQuery () const |
Returns the complex query as a document. More... | |
MLCLIENT_API void | setQueryText (std::string qtext) |
Sets the plain text query text. More... | |
MLCLIENT_API const std::string & | getQueryText () const |
Returns the plain text query. More... | |
MLCLIENT_API ITextDocumentContent * | getPayload () const |
Returns a string representation of the total payload for this search, as passed to MarkLogic Server. More... | |
searchdescription_parameters Common REST API call parameters to override options on the fly | |
MLCLIENT_API void | setStart (const long start) |
Sets the start (first result) index. These are 1 not 0 based in MarkLogic Server. More... | |
MLCLIENT_API const long | getStart () const |
Retrieves the start (first result) index. These are 1 not 0 based in MarkLogic Server. More... | |
MLCLIENT_API void | setPageLength (const long pageLength) |
Sets the number of results to return per page. More... | |
MLCLIENT_API const long | getPageLength () const |
Returns the number of results shown per page. More... | |
A POD class representing input to the POST of /v1/search - i.e. all search configuration.
May contain just query text, a complex query, options, or a mix thereof.
Used to simplify calls to Connection::search
Defaults to a blank text query (i.e. return all results) and default (server side configured) options.
|
virtual |
Default destructor.
MLCLIENT_API const ITextDocumentContent& mlclient::SearchDescription::getOptions | ( | ) | const |
Returns the options as a document.
MLCLIENT_API const long mlclient::SearchDescription::getPageLength | ( | ) | const |
Returns the number of results shown per page.
MLCLIENT_API ITextDocumentContent* mlclient::SearchDescription::getPayload | ( | ) | const |
Returns a string representation of the total payload for this search, as passed to MarkLogic Server.
Includes search complex query, query text, and options document, if supplied.
Used as the raw input to POST /v1/search, and encompasses all search configuration
MLCLIENT_API const ITextDocumentContent& mlclient::SearchDescription::getQuery | ( | ) | const |
Returns the complex query as a document.
MLCLIENT_API const std::string& mlclient::SearchDescription::getQueryText | ( | ) | const |
Returns the plain text query.
MLCLIENT_API const long mlclient::SearchDescription::getStart | ( | ) | const |
Retrieves the start (first result) index. These are 1 not 0 based in MarkLogic Server.
MLCLIENT_API void mlclient::SearchDescription::setOptions | ( | ITextDocumentContent & | options | ) |
Set the search options content.
Could be either an XML or JSON description of search options.
See CppRestJsonHelper or PugiXmlHelper to create a TextDocumentContent that wraps raw JSON or XML strings.
[in,out] | options | The search options as an XML or JSON IDocumentContent instance |
MLCLIENT_API void mlclient::SearchDescription::setPageLength | ( | const long | pageLength | ) |
Sets the number of results to return per page.
pageLength | The number of results per page to return |
MLCLIENT_API void mlclient::SearchDescription::setQuery | ( | ITextDocumentContent & | query | ) |
Sets the complex query using an XML or JSON IDocumentContent instance.
See CppRestJsonHelper or PugiXmlHelper to create a TextDocumentContent that wraps raw JSON or XML strings.
[in,out] | query | The TextDocumentContent instance wrapping the XML or JSON query. |
MLCLIENT_API void mlclient::SearchDescription::setQueryText | ( | std::string | qtext | ) |
Sets the plain text query text.
This can be used at the same time as a complex query in POST /v1/search (i.e. in Connection::search )
[in,out] | qtext | The plain text query |
MLCLIENT_API void mlclient::SearchDescription::setStart | ( | const long | start | ) |
Sets the start (first result) index. These are 1 not 0 based in MarkLogic Server.
start | The point in the result set to begin returning results from the server |