After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693935 - search: Simplify and correct behavior for substring searches
search: Simplify and correct behavior for substring searches
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-16 04:38 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-02-16 18:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
search: Simplify and correct behavior for substring searches (1.63 KB, patch)
2013-02-16 04:38 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
search: Simplify and correct behavior for substring searches (1.57 KB, patch)
2013-02-16 17:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-02-16 04:38:00 UTC
According to Cosimo, we should expect like search providers join
the terms, and care about order. Thus, we can't expect that an
addition to any of the terms is a subsearch.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-02-16 04:38:02 UTC
Created attachment 236343 [details] [review]
search: Simplify and correct behavior for substring searches

Early on, search was based on a list of terms, which was like a set
of tags, in that terms were OR'd, and that order didn't matter. As
such, modifying any one of the terms wouldn't produce new results.
Nowadays, providers take the order into account, so a substring
should only be the case if new terms are added to the end.
Comment 2 Cosimo Cecchi 2013-02-16 14:16:37 UTC
Review of attachment 236343 [details] [review]:

I think this is generally the correct thing to do, one comment below.

::: js/ui/search.js
@@ +70,3 @@
         let previousResultsArr = this._previousResults;
+        let isSubSearch = false;
+        if (previousResultsArr.length > 0)

I don't think this condition check is optimal - previous code had the value of isSubSearch only depending on the terms and not the results.
How about changing this to this._previousTerms.length?
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-02-16 17:39:09 UTC
Created attachment 236380 [details] [review]
search: Simplify and correct behavior for substring searches

Early on, search was based on a list of terms, which was like a set
of tags, in that terms were OR'd, and that order didn't matter. As
such, modifying any one of the terms wouldn't produce new results.
Nowadays, providers take the order into account, so a substring
should only be the case if new terms are added to the end.
Comment 4 Cosimo Cecchi 2013-02-16 18:22:04 UTC
Review of attachment 236380 [details] [review]:

Looks good to me
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-16 18:24:39 UTC
Attachment 236380 [details] pushed as b292bba - search: Simplify and correct behavior for substring searches