Commit 5408c767 authored by Jia's avatar Jia Committed by Commit Bot

[cros search service] Log results in inverted index search

Bug: 1090132
Change-Id: Ie61df11e6d051452ae70a13eb04022523938b23e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309309Reviewed-by: default avatarTony Yeoman <tby@chromium.org>
Commit-Queue: Jia Meng <jiameng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790266}
parent 5b5fc338
...@@ -79,10 +79,15 @@ ResponseStatus InvertedIndexSearch::Find(const base::string16& query, ...@@ -79,10 +79,15 @@ ResponseStatus InvertedIndexSearch::Find(const base::string16& query,
DCHECK(results); DCHECK(results);
results->clear(); results->clear();
if (query.empty()) { if (query.empty()) {
return ResponseStatus::kEmptyQuery; const ResponseStatus status = ResponseStatus::kEmptyQuery;
MaybeLogSearchResultsStats(status, 0u);
return status;
}
if (GetSize() == 0u) {
const ResponseStatus status = ResponseStatus::kEmptyIndex;
MaybeLogSearchResultsStats(status, 0u);
return status;
} }
if (GetSize() == 0u)
return ResponseStatus::kEmptyIndex;
// TODO(jiameng): actual input query may not be the same as default locale. // TODO(jiameng): actual input query may not be the same as default locale.
// Need another way to determine actual language of the query. // Need another way to determine actual language of the query.
...@@ -105,7 +110,10 @@ ResponseStatus InvertedIndexSearch::Find(const base::string16& query, ...@@ -105,7 +110,10 @@ ResponseStatus InvertedIndexSearch::Find(const base::string16& query,
if (results->size() > max_results && max_results > 0u) if (results->size() > max_results && max_results > 0u)
results->resize(max_results); results->resize(max_results);
return ResponseStatus::kSuccess;
const ResponseStatus status = ResponseStatus::kSuccess;
MaybeLogSearchResultsStats(status, results->size());
return status;
} }
std::vector<std::pair<std::string, uint32_t>> std::vector<std::pair<std::string, uint32_t>>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment