MarkLogic Connect
MarkLogic Connect Client API Collection
|
Represents a single search result. Wraps all REST API search result metadata and content. More...
#include <SearchResult.hpp>
Public Types | |
enum | Detail { SNIPPETS, CONTENT, NONE, CUSTOM } |
Public Member Functions | |
MLCLIENT_API | SearchResult () |
MLCLIENT_API | SearchResult (const SearchResult &other)=default |
MLCLIENT_API | SearchResult (SearchResult &&other) |
MLCLIENT_API SearchResult & | operator= (SearchResult &&other) |
SearchResult & | operator= (const SearchResult &&other) |
MLCLIENT_API | ~SearchResult () |
Destructor. | |
MLCLIENT_API | SearchResult (const long index, const std::string &uri, const std::string &path, const long score, const double confidence, const double fitness, const Detail &detail, IDocumentContent *detailContent=nullptr, const std::string &mimeType="", const Format &format=Format::JSON) |
MLCLIENT_API long | getIndex () |
Returns the (1 based) index of this result in the total search results, across all pages. More... | |
MLCLIENT_API const std::string & | getUri () const |
Returns the document uri of the result. More... | |
MLCLIENT_API const std::string & | getPath () const |
Returns the document (more accurately, fragment) XPath of the result. More... | |
MLCLIENT_API long | getScore () |
Returns the calculated search score for this result. More... | |
MLCLIENT_API double | getConfidence () |
Returns the calculated search confidence for this result. More... | |
MLCLIENT_API double | getFitness () |
Returns the calculated search fitness for this result. More... | |
MLCLIENT_API const Detail & | getDetail () const |
Returns the level of detail of this result. More... | |
MLCLIENT_API const IDocumentContent * | getDetailContent () const |
Returns the raw text content of this result. More... | |
MLCLIENT_API const std::string & | getMimeType () const |
Returns the MIME type of the result. More... | |
MLCLIENT_API const Format & | getFormat () const |
Returns the short text format of this result. More... | |
Represents a single search result. Wraps all REST API search result metadata and content.
A SearchResult in MarkLogic Server consistent of not just the result itself, but also its metadata. Indeed, using the "none" snippet option means no content is returned, leaving just the metadata.
|
strong |
Represents one of the snippetting options in use by the search result
MLCLIENT_API mlclient::SearchResult::SearchResult | ( | ) |
Empty constructor
|
default |
Copy constructor
other | The SearchResult to copy (shallow copy) |
MLCLIENT_API mlclient::SearchResult::SearchResult | ( | SearchResult && | other | ) |
Move constructor
other | The SearchResult to move (deep reference move) |
MLCLIENT_API mlclient::SearchResult::SearchResult | ( | const long | index, |
const std::string & | uri, | ||
const std::string & | path, | ||
const long | score, | ||
const double | confidence, | ||
const double | fitness, | ||
const Detail & | detail, | ||
IDocumentContent * | detailContent = nullptr , |
||
const std::string & | mimeType = "" , |
||
const Format & | format = Format::JSON |
||
) |
Detail constructor. Used by SearchResultSet and other search result wrapping functions and classes.
index | The index (position, 1 based) of this result in the total search result list, across all pages |
uri | The document URI this search result represents |
path | The XPath representing this document (more accurately, MarkLogic Fragment) |
score | The search score calculated for this result |
confidence | The search confidence calculated for this result |
fitness | The search fitness calculated for this result |
detail | The level of snippet detail returned from the result |
detailContent | The raw text content of the search result |
mimeType | The MIME type of the result content |
format | The REST API format of the result (can be "json" or "xml" or "binary" or "text" or "none") |
MLCLIENT_API double mlclient::SearchResult::getConfidence | ( | ) |
Returns the calculated search confidence for this result.
MLCLIENT_API const Detail& mlclient::SearchResult::getDetail | ( | ) | const |
Returns the level of detail of this result.
MLCLIENT_API const IDocumentContent* mlclient::SearchResult::getDetailContent | ( | ) | const |
Returns the raw text content of this result.
MLCLIENT_API double mlclient::SearchResult::getFitness | ( | ) |
Returns the calculated search fitness for this result.
MLCLIENT_API const Format& mlclient::SearchResult::getFormat | ( | ) | const |
Returns the short text format of this result.
MLCLIENT_API long mlclient::SearchResult::getIndex | ( | ) |
Returns the (1 based) index of this result in the total search results, across all pages.
MLCLIENT_API const std::string& mlclient::SearchResult::getMimeType | ( | ) | const |
Returns the MIME type of the result.
MLCLIENT_API const std::string& mlclient::SearchResult::getPath | ( | ) | const |
Returns the document (more accurately, fragment) XPath of the result.
MLCLIENT_API long mlclient::SearchResult::getScore | ( | ) |
Returns the calculated search score for this result.
MLCLIENT_API const std::string& mlclient::SearchResult::getUri | ( | ) | const |
Returns the document uri of the result.
MLCLIENT_API SearchResult& mlclient::SearchResult::operator= | ( | SearchResult && | other | ) |
Move assignment operator
SearchResult& mlclient::SearchResult::operator= | ( | const SearchResult && | other | ) |
Copy assignment operator