Skip to content

Commit

Permalink
Increase number of matches SearchProvider can return to the full popu…
Browse files Browse the repository at this point in the history
…p size,

assuming:

(1) Instant Extended is enabled (so we can get metrics comparing before/after)
(2) The extra matches come from server-scored suggestions.  We allow the highest
ranking 3 non-verbatim matches to come from any source, but after that we only
allow server-scored matches (and verbatim matches) until we hit the result set
limit.

This requires extending the Result class in the search provider to track the
origin of each match's score, as well as recording this information in the
AutocompleteMatch's |additional_info| field.

Note that https://codereview.chromium.org/17391005/ will simplify this somewhat
since we'll be able to stop worrying about FinalizeInstantQuery() etc.

BUG=252506
TEST=With instant extended on, type a query that generates lots of suggestions and see you get a full dropdown worth.
R=mpearson@chromium.org, msw@chromium.org

Review URL: https://codereview.chromium.org/17382015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208567 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pkasting@chromium.org committed Jun 25, 2013
1 parent f3a1d40 commit d30268a
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 93 deletions.
6 changes: 6 additions & 0 deletions chrome/browser/autocomplete/autocomplete_match.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,12 @@ void AutocompleteMatch::RecordAdditionalInfo(const std::string& property,
UTF16ToUTF8(base::TimeFormatShortDateAndTime(value)));
}

std::string AutocompleteMatch::GetAdditionalInfo(
const std::string& property) const {
AdditionalInfo::const_iterator i(additional_info.find(property));
return (i == additional_info.end()) ? std::string() : i->second;
}

#ifndef NDEBUG
void AutocompleteMatch::Validate() const {
ValidateClassifications(contents, contents_class);
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/autocomplete/autocomplete_match.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ struct AutocompleteMatch {
void RecordAdditionalInfo(const std::string& property,
const base::Time& value);

// Returns the value recorded for |property| in the |additional_info|
// dictionary. Returns the empty string if no such value exists.
std::string GetAdditionalInfo(const std::string& property) const;

// The provider of this match, used to remember which provider the user had
// selected when the input changes. This may be NULL, in which case there is
// no provider (or memory of the user's selection).
Expand Down
Loading

0 comments on commit d30268a

Please sign in to comment.