Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Issue 701553002: Allow systematic prefix search in bookmarks. (Closed)

Created:
6 years, 1 month ago by lpromero
Modified:
6 years, 1 month ago
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Allow systematic prefix search in bookmarks. This CL allows the bookmark model's search to always use prefix search, even when terms are too short. BUG=415774

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -28 lines) Patch
M components/bookmarks/browser/bookmark_index.h View 2 chunks +13 lines, -6 lines 2 comments Download
M components/bookmarks/browser/bookmark_index.cc View 5 chunks +13 lines, -6 lines 0 comments Download
M components/bookmarks/browser/bookmark_index_unittest.cc View 4 chunks +75 lines, -5 lines 0 comments Download
M components/bookmarks/browser/bookmark_model.h View 1 chunk +9 lines, -0 lines 0 comments Download
M components/bookmarks/browser/bookmark_model.cc View 1 chunk +13 lines, -2 lines 2 comments Download
M components/bookmarks/browser/bookmark_utils.cc View 1 chunk +1 line, -0 lines 0 comments Download
M components/history/core/browser/url_database.cc View 1 chunk +2 lines, -1 line 0 comments Download
M components/query_parser/query_parser.h View 2 chunks +13 lines, -2 lines 0 comments Download
M components/query_parser/query_parser.cc View 5 chunks +49 lines, -4 lines 3 comments Download
M components/query_parser/query_parser_unittest.cc View 4 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
lpromero
6 years, 1 month ago (2014-11-03 17:31:17 UTC) #2
lpromero
6 years, 1 month ago (2014-11-03 17:31:42 UTC) #4
noyau (Ping after 24h)
lgtm
6 years, 1 month ago (2014-11-03 17:38:55 UTC) #5
Kibeom Kim (inactive)
https://codereview.chromium.org/701553002/diff/1/components/query_parser/query_parser.cc File components/query_parser/query_parser.cc (right): https://codereview.chromium.org/701553002/diff/1/components/query_parser/query_parser.cc#newcode149 components/query_parser/query_parser.cc:149: class QueryNodePrefixWord : public QueryNodeWord { It looks like ...
6 years, 1 month ago (2014-11-03 18:41:32 UTC) #6
Kibeom Kim (inactive)
6 years, 1 month ago (2014-11-03 18:42:01 UTC) #8
lpromero
sky@chromium.org: Please review changes in all files.
6 years, 1 month ago (2014-11-03 18:42:10 UTC) #10
noyau (Ping after 24h)
On 2014/11/03 18:42:10, lpromero wrote: > mailto:sky@chromium.org: Please review changes in all files. A little ...
6 years, 1 month ago (2014-11-03 18:47:50 UTC) #11
sky
https://codereview.chromium.org/701553002/diff/1/components/bookmarks/browser/bookmark_index.h File components/bookmarks/browser/bookmark_index.h (right): https://codereview.chromium.org/701553002/diff/1/components/bookmarks/browser/bookmark_index.h#newcode74 components/bookmarks/browser/bookmark_index.h:74: // When |always_prefix_search| is false, if the term is ...
6 years, 1 month ago (2014-11-03 21:44:06 UTC) #12
Kibeom Kim (inactive)
6 years, 1 month ago (2014-11-04 01:28:19 UTC) #13
continuing at https://codereview.chromium.org/703553002/

https://codereview.chromium.org/701553002/diff/1/components/bookmarks/browser...
File components/bookmarks/browser/bookmark_index.h (right):

https://codereview.chromium.org/701553002/diff/1/components/bookmarks/browser...
components/bookmarks/browser/bookmark_index.h:74: // When |always_prefix_search|
is false, if the term is not long enough in the
On 2014/11/03 21:44:05, sky wrote:
> This description is confusing. I think you want something like:
> When |always_prefix_search| is true, the term is always considered for a
prefix
> search. If false, the behavior of exact match depends on
> |query_parser::QueryParser::IsWordLongEnoughForPrefixSearch|. If the term is
> long enough for a prefix search a prefix search is done, otherwise an exact
> match is done.

Done. (removed since we put enum and it's self-explanatory)

https://codereview.chromium.org/701553002/diff/1/components/bookmarks/browser...
File components/bookmarks/browser/bookmark_model.cc (right):

https://codereview.chromium.org/701553002/diff/1/components/bookmarks/browser...
components/bookmarks/browser/bookmark_model.cc:710: text, max_count, true /*
always_prefix_search */, matches);
On 2014/11/03 21:44:05, sky wrote:
> I'm not a fan of this style. It's a good indication you should use an enum.

Done.

https://codereview.chromium.org/701553002/diff/1/components/query_parser/quer...
File components/query_parser/query_parser.cc (right):

https://codereview.chromium.org/701553002/diff/1/components/query_parser/quer...
components/query_parser/query_parser.cc:149: class QueryNodePrefixWord : public
QueryNodeWord {
On 2014/11/03 21:44:05, sky wrote:
> On 2014/11/03 18:41:32, Kibeom Kim wrote:
> > It looks like this class is identical to QueryNodeWord just except
> > |QueryParser::IsWordLongEnoughForPrefixSearch|. Can we keep as one class and
> > branch by a constructor argument? I think it makes sense to use template in
> this
> > case. Maybe something like
> > 
> > template <bool PREFIX_WORD_MATCH>
> > class QueryNodeWord {
> > ...
> > }
> 
> Why bother with a template and not a field, always_prefix_search?

Done.

Since the class is local to this file and not used elsewhere, I thought it'll be
good to make compile-time fixed code by template, but yeah, it wasn't a good
suggestion.

Powered by Google App Engine
This is Rietveld 408576698