本文整理汇总了C++中SearchEngineInterface::setLimitSet方法的典型用法代码示例。如果您正苦于以下问题:C++ SearchEngineInterface::setLimitSet方法的具体用法?C++ SearchEngineInterface::setLimitSet怎么用?C++ SearchEngineInterface::setLimitSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchEngineInterface
的用法示例。
在下文中一共展示了SearchEngineInterface::setLimitSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doWork
void EngineQueryThread::doWork(void)
{
PinotSettings &settings = PinotSettings::getInstance();
// Get the SearchEngine
SearchEngineInterface *pEngine = SearchEngineFactory::getSearchEngine(m_engineName, m_engineOption);
if (pEngine == NULL)
{
m_errorNum = UNKNOWN_ENGINE;
m_errorParam = m_engineDisplayableName;
return;
}
// Set up the proxy
DownloaderInterface *pDownloader = pEngine->getDownloader();
if ((pDownloader != NULL) &&
(settings.m_proxyEnabled == true) &&
(settings.m_proxyAddress.empty() == false))
{
char portStr[64];
pDownloader->setSetting("proxyaddress", settings.m_proxyAddress);
snprintf(portStr, 64, "%u", settings.m_proxyPort);
pDownloader->setSetting("proxyport", portStr);
pDownloader->setSetting("proxytype", settings.m_proxyType);
}
if (m_listingIndex == false)
{
pEngine->setLimitSet(m_limitToDocsSet);
}
// Run the query
pEngine->setDefaultOperator(SearchEngineInterface::DEFAULT_OP_AND);
if (pEngine->runQuery(m_queryProps, m_startDoc) == false)
{
m_errorNum = QUERY_FAILED;
m_errorParam = m_engineDisplayableName;
}
else
{
const vector<DocumentInfo> &resultsList = pEngine->getResults();
m_documentsList.clear();
m_documentsList.reserve(resultsList.size());
m_documentsCount = pEngine->getResultsCountEstimate();
#ifdef DEBUG
cout << "EngineQueryThread::doWork: " << resultsList.size() << " off " << m_documentsCount
<< " results to process, starting at position " << m_startDoc << endl;
#endif
m_resultsCharset = pEngine->getResultsCharset();
if (m_listingIndex == false)
{
processResults(resultsList);
}
else
{
processResults(resultsList,
PinotSettings::getInstance().getIndexIdByName(m_engineDisplayableName));
}
// Any spelling correction ?
string correctedFreeQuery(pEngine->getSpellingCorrection());
if (correctedFreeQuery.empty() == false)
{
m_correctedSpelling = true;
m_queryProps.setFreeQuery(correctedFreeQuery);
}
}
delete pEngine;
}