• Moe Ahmadi's avatar
    [PZPS] Adds the PZPS header text information to the Autocomplete model · bde3d009
    Moe Ahmadi authored
    The PZPS header information is expected in the following format in the
    Chrome suggest response. Every suggestion with a header has a header group
    id in its respective "google:suggestdetail" dictionary which maps to
    a header text inside "google:headertexts>a".
    
    ...
    "google:headertexts":{
      "a":{
        "40009":"Recommended for you"
      }
    },
    "google:suggestdetail":[
      ...
      {
        "zl":40009
      },
      {
        "zl":40009
      }
    ],
    ...
    
    This CL parses that information and adds the respective header as a
    |header| field on the first ACMatch in every group of adjacent matches
    with the same header, unless:
    1) Matches with the same header are not adjacent to one another, i.e.,
       are interleaved by matches with different headers or matches without
       one.
    2) Matches without a header come after the ones with headers.
    
    Note that the headers do not determine classification or ranking of
    the matches. They are expected to be valid after the
    AutocompleteResult is finalized. These error conditions, however, are
    in place to safeguard the integrity of the displayed headers.
    
    Bug: 1052519
    Change-Id: Ibbd3a812690605cd13763e41f109197ef75c1727
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079303Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
    Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#746130}
    bde3d009
search_suggestion_parser.cc 23.7 KB