GNOME Bugzilla – Bug 745036
Add way to search by tags only
Last modified: 2021-05-26 22:24:41 UTC
The goal of this bug report is to add a way to find files by tags only. Actually when a search is done, the text entered is looked in several data of the documents (content, title, tags, ...). For my need, I want to have a way to search by tags only. So I can find bills I have to pay without viewing all bills in my documents. Indeed, if I search actually for a term like "to pay", every bills containing this term will be shown even if it doesn't have this tag associated. Tracker-needle already contains all stuff needed to add a button to search by tags only. So I've created 3 patches to solve this bug, see attached files and my git repo : https://git.adorsaz.ch/?p=tracker.git;a=shortlog;h=refs/heads/search_by_tags_only Regards, Adrien
Created attachment 297689 [details] [review] Add a button to search by tags
Created attachment 297690 [details] [review] Add logic to search by tags
Created attachment 297691 [details] [review] Fix query model assertion to find by tags
Review of attachment 297689 [details] [review]: Looks right to me, please go ahead and commit.
Review of attachment 297690 [details] [review]: Looks right to me, please go ahead and commit.
Review of attachment 297691 [details] [review]: Looks right to me, please go ahead and commit.
Finally, thank you for the patches. One thing I would note - the tag searching *is* case sensitive - you may want to change that. I'm not sure myself :)
I've checked about tag sensitivity: from the tag list on the right, I've seen that tags are themselves sensitive. Indeed I've both tags "Adrien" and "adrien" in my documents. Actually, if I'm looking for "adrien" the result don't include "Adrien", but if I want to have both results, I just need to look for "adrien,Adrien". On the one hand, I'd prefer to have the results corresponding to my exact query (and I can extend my query to have more results), but, on the other hand, I understand that user can be surprised by such logic. The problem, with the second solution is that if we remove directly sensitivity in all queries, we won't be able to have exact queries. Maybe we should add a checkbox for sensitivity so we have the best of both worlds. I'll try this last solution and come back, thanks for the reviews !
Well, I've tried it and it works well with a case sensitive switch. I've noticed that search in title is only case sensitive. For consistency purpose, maybe we should either enable the switch for this option too or we shouldn't use a switch. I've noticed that in the title search query, we filter with lower cased file names, but we don't lower case the search entry : > "FILTER (fn:contains (fn:lower-case (nfo:fileName(?urn)), \"%s\"))" I think this behavior is strange, I think we should have either: > "FILTER (fn:contains (fn:lower-case (nfo:fileName(?urn)), fn:lower-case(\"%s\")))" or: > "FILTER (fn:contains (nfo:fileName(?urn), \"%s\"))"
Created attachment 299443 [details] [review] Add a sensitivity switch
Created attachment 299444 [details] [review] Add find insensitive tags query
Created attachment 299445 [details] [review] Add logic to do insensitive tag search
Created attachment 299874 [details] [review] tracker-needle: Add a button to search by tags
Sorry for the noise with latest comment (13), I've tried to understood how I had to "please ahead and commit", and I've tried to use git bz attach as noticed in the documentation. As I have no rights on any Gnome project git repository, I think I won't be able to commit to the tracker git. So, what should I do now ?
Hi, you don't have to do anything now. Any maintainer would probably review and push it. :)
(In reply to adrien from comment #14) > Sorry for the noise with latest comment (13), I've tried to understood how I > had to "please ahead and commit", and I've tried to use git bz attach as > noticed in the documentation. > > As I have no rights on any Gnome project git repository, I think I won't be > able to commit to the tracker git. So, what should I do now ? I can't commit the patches for some reason: $ git am 001_add_sensitivity_switch.patch Patch format detection failed. $ git am 002_add_find_insensitive_tags_query.patch Patch format detection failed. $ git am 003_add_logic_insensitive_tag_search.patch Patch format detection failed. Can you create the patches with: $ git format-patch -1 or similar?
Created attachment 300482 [details] [review] Add a switch to enable insensitive tag search
Created attachment 300483 [details] [review] Add a query to find tags without sensitivity
Created attachment 300484 [details] [review] Add logic to do insensitive tag search
I've tried to git am these new patchs and it seemed to work (I've applied them the three first patches which added the search by tag feature).
Hello, I've tried again to am latest revisions of the sensitivity related patches and they apply fine for me on recent master. Could you please try again ? I'm not sure if the "Sensitivity" label followed by a switch button is enough explicit for the user (and if the option should be activated by default). Another point, this time about the search by tag feature: I've not modified the SPARQL query for the search by tags, but I'm not sure if the request is good for this feature: by default, if I search upon several tags at once (separated by a comma ','), tracker-needle will search with a OR logic instead of a AND logic. See you, Adrien
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new enhancement request ticket at https://gitlab.gnome.org/GNOME/tracker/-/issues/ Thank you for your understanding and your help.