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

Issue 9316129: Don't strip punctuation inside quotes in history search queries. (Closed)

Created:
8 years, 10 months ago by Patrick Dubroy
Modified:
4 years, 4 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, tfarina
Visibility:
Public.

Description

Don't strip punctuation inside quotes in history search queries. Currently, the query parser strips all punctuation from history search queries, even inside quotes. A query like ["chromium.org"] will be passed to SQLite as ["chromium org"], meaning that pages on chromium.org will not be matched unless they contain the literal string "chromium org" somewhere. BUG=100545 TEST=Do a search on chrome://history for a domain that you have previously visited, e.g. "chromium.org", and ensure that history entries matching this domain are found. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=121423

Patch Set 1 #

Patch Set 2 : Add unit tests to verify fix. #

Total comments: 5

Patch Set 3 : New patch based on chat with mrossetti. #

Total comments: 10

Patch Set 4 : Address comments. #

Patch Set 5 : Change non-breaking characters to '.' and '-'. #

Total comments: 17

Patch Set 6 : Address reviewer comments. #

Patch Set 7 : Rebase. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -60 lines) Patch
M chrome/browser/history/query_parser.cc View 1 2 3 4 5 6 8 chunks +53 lines, -21 lines 3 comments Download
M chrome/browser/history/query_parser_unittest.cc View 1 2 3 4 5 6 3 chunks +25 lines, -0 lines 0 comments Download
M chrome/browser/history/text_database_manager_unittest.cc View 1 2 3 4 5 6 22 chunks +106 lines, -39 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
Patrick Dubroy
This is probably not a final solution, but I wanted to get the conversation started ...
8 years, 10 months ago (2012-02-06 12:03:20 UTC) #1
tfarina
On 2012/02/06 12:03:20, dubroy wrote: > This is probably not a final solution, but I ...
8 years, 10 months ago (2012-02-06 16:39:14 UTC) #2
sky
I'm not intimately familiar with fts. Do we end stripping punctuation from the content we ...
8 years, 10 months ago (2012-02-06 16:59:21 UTC) #3
brettw
On Mon, Feb 6, 2012 at 8:59 AM, <sky@chromium.org> wrote: > I'm not intimately familiar ...
8 years, 10 months ago (2012-02-06 17:43:38 UTC) #4
Patrick Dubroy
On 2012/02/06 17:43:38, brettw wrote: > On Mon, Feb 6, 2012 at 8:59 AM, <mailto:sky@chromium.org> ...
8 years, 10 months ago (2012-02-06 18:02:38 UTC) #5
Peter Kasting
Exchanged mrossetti for myself since he'll know more about whether the autocomplete system uses the ...
8 years, 10 months ago (2012-02-06 18:32:01 UTC) #6
mrossetti
http://codereview.chromium.org/9316129/diff/1002/chrome/browser/history/query_parser.cc File chrome/browser/history/query_parser.cc (right): http://codereview.chromium.org/9316129/diff/1002/chrome/browser/history/query_parser.cc#newcode83 chrome/browser/history/query_parser.cc:83: void AppendText(const string16& text) { word_ += text; } ...
8 years, 10 months ago (2012-02-07 01:05:57 UTC) #7
Patrick Dubroy
Can you guys please take another look? (Especially mrossetti, and shess if you have any ...
8 years, 10 months ago (2012-02-08 22:06:41 UTC) #8
sky
http://codereview.chromium.org/9316129/diff/11001/chrome/browser/history/query_parser.cc File chrome/browser/history/query_parser.cc (right): http://codereview.chromium.org/9316129/diff/11001/chrome/browser/history/query_parser.cc#newcode86 chrome/browser/history/query_parser.cc:86: // A QueryNodeWord is a single word in the ...
8 years, 10 months ago (2012-02-08 23:31:28 UTC) #9
mrossetti
http://codereview.chromium.org/9316129/diff/11001/chrome/browser/history/query_parser_unittest.cc File chrome/browser/history/query_parser_unittest.cc (right): http://codereview.chromium.org/9316129/diff/11001/chrome/browser/history/query_parser_unittest.cc#newcode86 chrome/browser/history/query_parser_unittest.cc:86: EXPECT_EQ("test*", QueryToString("--test")); Excellent unit test additions! May I suggest ...
8 years, 10 months ago (2012-02-09 00:27:03 UTC) #10
Patrick Dubroy
Thanks for the comments, I've addressed them all. I've also changed what characters are treated ...
8 years, 10 months ago (2012-02-09 14:46:59 UTC) #11
mrossetti
On 2012/02/09 14:46:59, dubroy wrote: > Thanks for the comments, I've addressed them all. I've ...
8 years, 10 months ago (2012-02-09 17:27:19 UTC) #12
Scott Hess - ex-Googler
On 2012/02/06 16:59:21, sky wrote: > I'm not intimately familiar with fts. Do we end ...
8 years, 10 months ago (2012-02-09 19:02:51 UTC) #13
Scott Hess - ex-Googler
On 2012/02/09 14:46:59, dubroy wrote: > Thanks for the comments, I've addressed them all. I've ...
8 years, 10 months ago (2012-02-09 19:12:22 UTC) #14
Scott Hess - ex-Googler
Hmm, also, if you really want to restrict to google.com, you could also do the ...
8 years, 10 months ago (2012-02-09 19:21:02 UTC) #15
Patrick Dubroy
On 2012/02/09 19:12:22, shess wrote: > On 2012/02/09 14:46:59, dubroy wrote: > > Thanks for ...
8 years, 10 months ago (2012-02-09 20:01:02 UTC) #16
Patrick Dubroy
On 2012/02/09 19:21:02, shess wrote: > Hmm, also, if you really want to restrict to ...
8 years, 10 months ago (2012-02-09 20:04:06 UTC) #17
Patrick Dubroy
Here's a new version that reflects my earlier comment: now only '.' and '-' are ...
8 years, 10 months ago (2012-02-09 20:50:35 UTC) #18
mrossetti
lgtm
8 years, 10 months ago (2012-02-09 21:01:22 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dubroy@chromium.org/9316129/15004
8 years, 10 months ago (2012-02-10 08:57:55 UTC) #20
Patrick Dubroy
On 2012/02/10 08:57:55, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
8 years, 10 months ago (2012-02-10 10:02:46 UTC) #21
commit-bot: I haz the power
Change committed as 121423
8 years, 10 months ago (2012-02-10 10:38:31 UTC) #22
Patrick Dubroy
On 2012/02/10 10:38:31, I haz the power (commit-bot) wrote: > Change committed as 121423 Oh. ...
8 years, 10 months ago (2012-02-10 12:03:00 UTC) #23
sky
http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/query_parser.cc File chrome/browser/history/query_parser.cc (right): http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/query_parser.cc#newcode154 chrome/browser/history/query_parser.cc:154: void QueryNodeWord::Append(const string16& str) { Definition should match declaration ...
8 years, 10 months ago (2012-02-10 16:53:35 UTC) #24
mrossetti
http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/query_parser.cc File chrome/browser/history/query_parser.cc (right): http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/query_parser.cc#newcode390 chrome/browser/history/query_parser.cc:390: if (IsQueryQuote(last_char)) { I almost commented on that as ...
8 years, 10 months ago (2012-02-10 17:33:43 UTC) #25
brettw
Whoops, there was no set noparent on history so anybody can review. Otherwise, commit-bot wouldn't ...
8 years, 10 months ago (2012-02-10 17:47:11 UTC) #26
Scott Hess - ex-Googler
http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/text_database_manager_unittest.cc File chrome/browser/history/text_database_manager_unittest.cc (right): http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/text_database_manager_unittest.cc#newcode590 chrome/browser/history/text_database_manager_unittest.cc:590: EXPECT_EQ(0U, results.size()); I don't understand how this one is ...
8 years, 10 months ago (2012-02-10 22:22:32 UTC) #27
Scott Hess - ex-Googler
On 2012/02/10 22:22:32, shess wrote: > http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/text_database_manager_unittest.cc > File chrome/browser/history/text_database_manager_unittest.cc (right): > > http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/text_database_manager_unittest.cc#newcode590 > ...
8 years, 10 months ago (2012-02-10 22:31:37 UTC) #28
Patrick Dubroy
http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/text_database_manager_unittest.cc File chrome/browser/history/text_database_manager_unittest.cc (right): http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/text_database_manager_unittest.cc#newcode590 chrome/browser/history/text_database_manager_unittest.cc:590: EXPECT_EQ(0U, results.size()); On 2012/02/10 22:22:32, shess wrote: > I ...
8 years, 10 months ago (2012-02-11 10:58:38 UTC) #29
Scott Hess - ex-Googler
On 2012/02/09 20:01:02, dubroy wrote: > My understanding of FTS is that it's indexed based ...
8 years, 10 months ago (2012-02-11 17:09:54 UTC) #30
Scott Hess - ex-Googler
On 2012/02/09 20:04:06, dubroy wrote: > On 2012/02/09 19:21:02, shess wrote: > > Hmm, also, ...
8 years, 10 months ago (2012-02-11 17:13:51 UTC) #31
Scott Hess - ex-Googler
On 2012/02/11 17:09:54, shess wrote: > Hmm. One thing which could differ is that I'm ...
8 years, 10 months ago (2012-02-11 17:29:04 UTC) #32
Patrick Dubroy
On 2012/02/11 17:29:04, shess wrote: > On 2012/02/11 17:09:54, shess wrote: > > Hmm. One ...
8 years, 10 months ago (2012-02-11 18:17:28 UTC) #33
Scott Hess - ex-Googler
On 2012/02/11 18:17:28, dubroy wrote: > On 2012/02/11 17:29:04, shess wrote: > > then your ...
8 years, 10 months ago (2012-02-11 19:13:18 UTC) #34
Patrick Dubroy
Any more thoughts on this? On 2012/02/11 19:13:18, shess wrote: > On 2012/02/11 18:17:28, dubroy ...
8 years, 10 months ago (2012-02-14 17:19:02 UTC) #35
Scott Hess - ex-Googler
Sorry about the delay - earlier in the week we noted a crasher which snuck ...
8 years, 10 months ago (2012-02-17 18:05:33 UTC) #36
Patrick Dubroy
On 2012/02/17 18:05:33, shess wrote: > Sorry about the delay - earlier in the week ...
8 years, 10 months ago (2012-02-17 18:34:01 UTC) #37
Scott Hess - ex-Googler
On 2012/02/17 18:34:01, dubroy wrote: > On 2012/02/17 18:05:33, shess wrote: > > Given how ...
8 years, 10 months ago (2012-02-17 22:34:58 UTC) #38
Patrick Dubroy
http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/query_parser.cc File chrome/browser/history/query_parser.cc (right): http://codereview.chromium.org/9316129/diff/15004/chrome/browser/history/query_parser.cc#newcode154 chrome/browser/history/query_parser.cc:154: void QueryNodeWord::Append(const string16& str) { On 2012/02/10 16:53:35, sky ...
8 years, 10 months ago (2012-02-20 11:00:36 UTC) #39
Patrick Dubroy
Hi Scott, I'd like to revive this CL. To summarize the problem, searches on the ...
7 years, 8 months ago (2013-04-16 13:19:00 UTC) #40
Scott Hess - ex-Googler
On 2013/04/16 13:19:00, dubroy wrote: > I'd like to revive this CL. Looking at the ...
7 years, 8 months ago (2013-04-16 20:34:43 UTC) #41
Scott Hess - ex-Googler
AFAICT, I think my previous reservations about whether-this-is-right-at-all are all addressed. My remaining concern is ...
7 years, 8 months ago (2013-04-17 18:14:02 UTC) #42
Patrick Dubroy
7 years, 7 months ago (2013-05-15 09:48:06 UTC) #43
Sigh. Unfortunately I am going to have to put this off again for a while. Thanks
for you help though.

On 2013/04/17 18:14:02, shess wrote:
> AFAICT, I think my previous reservations about whether-this-is-right-at-all
are
> all addressed.  My remaining concern is mostly about whether the logic is
right
> if there are scripts which don't throw up English-style word/non-word/word
> sequences.
> 
>
https://chromiumcodereview.appspot.com/9316129/diff/37002/chrome/browser/hist...
> File chrome/browser/history/query_parser.cc (right):
> 
>
https://chromiumcodereview.appspot.com/9316129/diff/37002/chrome/browser/hist...
> chrome/browser/history/query_parser.cc:92: void Append(const string16& word);
> I think this sense of "Append" is enough different from the sense of "Append"
> inherited from QueryNode that maybe it would be worth changing to something
> else.  Accumulate?  And I prefer the |str| usage over |word|, or some other
term
> implying bag-o-chars.
> 
>
https://chromiumcodereview.appspot.com/9316129/diff/37002/chrome/browser/hist...
> chrome/browser/history/query_parser.cc:402: } else if (iter.IsWord() ||
> (in_quotes && !IsWhitespace(first_char))) {
> Previously, if there were a sequence of IsWord() tokens without intervening
> !IsWord() tokens, it would become a sequence of QueryNodeWord children.  Now
> they will be appended together into a single QueryNodeWord.
> 
>
https://chromiumcodereview.appspot.com/9316129/diff/37002/chrome/browser/hist...
> chrome/browser/history/query_parser.cc:419:
> current_word->Append(iter.GetString());
> I believe this won't back out the symbol(s) if the next token is a non-word. 
> Intentional to allow training non-breaking symbols?  If so, the comment should
> be modified.
> 
> I'm trying to think of how this could just accumulate the word using prev()
and
> pos(), then capture it once, but AFAICT it would require too many points to
> commit the word.  You could accumulate the non-breaking symbols in a string16,
> and change the above to accumulate them on the end of the previous word before
> the new word, then clear the symbol accumulator when opening a new
current_word.
> 
> I think that could also handle the adjacent IsWord() problem mentioned above. 
> Append if there is a current_word _and_ the non-breaking accumulator has
> content, otherwise push a new QueryNodeWord.

Powered by Google App Engine
This is Rietveld 408576698