Enable configuration of max workspace search results.

This commit is contained in:
Jacob Dufault 2017-04-17 20:54:20 -07:00
parent c86dd569c1
commit 2b6f4b7cdf
2 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,6 @@
namespace {
const int kMaxWorkspaceSearchResults = 1000;
const bool kUseMultipleProcesses = false; // TODO: initialization options not passed properly when set to true.
@ -1519,8 +1518,8 @@ void QueryDbMainLoop(
std::string query = msg->params.query;
for (int i = 0; i < db->detailed_names.size(); ++i) {
if (response.result.size() > kMaxWorkspaceSearchResults) {
std::cerr << "Query exceeded maximum number of responses (" << kMaxWorkspaceSearchResults << "), output may not contain all results" << std::endl;
if (response.result.size() >= config->maxWorkspaceSearchResults) {
std::cerr << "Query exceeded maximum number of responses (" << config->maxWorkspaceSearchResults << "), output may not contain all results" << std::endl;
break;
}

View File

@ -60,8 +60,9 @@ struct IndexerConfig {
NonElidedVector<std::string> whitelist;
NonElidedVector<std::string> blacklist;
int indexerCount = 1;
int maxWorkspaceSearchResults = 1000;
};
MAKE_REFLECT_STRUCT(IndexerConfig, cacheDirectory, whitelist, blacklist, indexerCount);
MAKE_REFLECT_STRUCT(IndexerConfig, cacheDirectory, whitelist, blacklist, indexerCount, maxWorkspaceSearchResults);