tag/categories search/filter
Posted: Thu Apr 14, 2022 11:30 am
There should be a way to filter/search by multiple tags and, very importantly, exclude tag.
(when I say tags, I am referring to what XnViewMP calls categories, but the rest of the World calls tags. I will call them tags, in this comment, and indeed thread. But remember: I am talking about what XnViewMP calls categories)
I suppose the same could/should also apply to doing the same, for metadata in files and/or sidecars. (I don't use those and am only really concerned with the tags in the XnViewMP catalogue database, but it should still apply)
I have (before I registered on this forum) done some internet searches, and found forum posts on this forum, with such bizarre statements, as "a good idea, discussed ages ago but nobody came up with a good GUI to select multi/exclude Categories".
This is utterly absurd, as there are old tried and true methods for exactly that, that work perfectly well, as I'll go through below
…but also:
This thread (viewtopic.php?t=17924) suggests that it has had some such capabilities …which have presumably been removed?
…and XnView apparently allows/allowed you to choose multiple tags, but only with OR, and not AND (viewtopic.php?t=21338 To quote from the thread "When I click on few categories the application shows all images which have ANY of the selected categories."
Back to how it would be easy to do:
Boolean operators have always been fundamental to all programming languages, and have been widely used in programs, right from the start
It would be easy to simply have a filter/search-bar, where you write in the tags and use boolean operators. (with the same autocompletion suggestions for tags, that you get in the "Categories"-panel [in the bar I've circled in the attached image] …except without the option of creating new tags, of course)
It would work perfectly well.
Like so:
To including [tag1] and [tag2], but exclude [tag3]:
[tag1] AND [tag2] NOT [tag3]
To search/filter for images with [tag1] and/or [tag2]
[tag1] OR [tag2]
To search/filter for images with [tag1] or [tag2], but not both
[tag1] XOR [tag2]
…and I'd suggest the ability to use of parentheses, as well.
Such as if you want images with [tag1] as well as one of the additional tags of [tag2] or [tag3] (but not both). That is images that have [tag1] and [tag2], or [tag1] and [tag3] (but not both [tag2] and [tag3]):
[tag1] AND ([tag2] XOR [tag3])
Some may now suspect, that using parentheses would cause a problem, due to some tags having parentheses in their name …but that wouldn't be a problem.
After all, what one writes in the filter/search-bar, could not possibly be treated by the program, as a simple text-string, with the text as one has written it.
After all, one can have several different tags, with the same name!
Writing the name of a tag, and just having that as simple text, to represent it, would create a conflict with the different tags with that same name. The program would not be able to distinguish which one is meant.
The autocompletion suggestions for tags, as in the "Categories"-panel (again: in the bar I've circled in the attached image), is an obvious neccesity, to identity the exact tag one means. Hence the tags have to be identified and then input in the filter/search-bar, as a distinct entity. (so the program would have to treat it as a separate and distinct entity, from the boolean operators and parentheses)
That said, it would be good to be able to search for tags with the same name, or (using wildcards) tags that have something as part of their name.
Of course, rather than using AND, NOT, OR, and XOR, you could choose to make it more intuitive and quick, and instead use '+' before tags to include, and '-' in front or those to exclude.
Use of parentheses would be exactly the same, of course (and their use is familiar to anyone with a bit of elementary school maths)
…but I'm not sure what characters would work best as replacements for OR and XOR, though. (maybe best to just keep those as OR and XOR?)
Like so:
To including [tag1] and [tag2], but exclude [tag3]:
+[tag1] +[tag2] -[tag3]
To search/filter for images with [tag1] and/or [tag2]
[tag1] OR [tag2]
To search/filter for images with [tag1] or [tag2], but not both
[tag1] XOR [tag2]
If you want images with [tag1] as well as one of the additional tags of [tag2] or [tag3] (but not both):
+[tag1] +([tag2] XOR [tag3])
Another thing that should added to the search/filter-bar, would be setting its scope:
All images in the catalogue, or a set folder …or multiple folders. (with options for including sub-folders, and when including subfolder, also having the option to exclude specific sub-folders)
Also, in addition to the search/filter-bar, having a panel that looks more or less like the "Categories"-panel, that can be used to choose tags for the search/filter-bar, would be a nice option.
Where the "Categories"-panel lets you press boxes, to set the tags of the selected image(s), this panel would have you press boxes to include tags in the search bar …and press the box again, to sets the tag to be excluded instead. (a third press, removing it from the search/filter-bar)
Naturally, any OR, XOR, and/or parentheses would have to be adjusted in the search/filter-bar, rather than in the panel.
Adding that panel, should be very easy, as it would, in large part, be a copy of the existing "Categories"-panel. (they would just need something to set it apart, visually, to avoid confusing them for each other)
As for where to place the search/filter-bar…
Putting in a down arrow (as on the layout menu on the toolbar, or to the right of the circled area in the attached image) on the "quick search"-bar, to allow one to switch between quick search and tag search/filtering. (or quick search, what XnView calls categories, embedded/sidecar tags, and categories+embedded/sidecar-tags)
(when I say tags, I am referring to what XnViewMP calls categories, but the rest of the World calls tags. I will call them tags, in this comment, and indeed thread. But remember: I am talking about what XnViewMP calls categories)
I suppose the same could/should also apply to doing the same, for metadata in files and/or sidecars. (I don't use those and am only really concerned with the tags in the XnViewMP catalogue database, but it should still apply)
I have (before I registered on this forum) done some internet searches, and found forum posts on this forum, with such bizarre statements, as "a good idea, discussed ages ago but nobody came up with a good GUI to select multi/exclude Categories".
This is utterly absurd, as there are old tried and true methods for exactly that, that work perfectly well, as I'll go through below
…but also:
This thread (viewtopic.php?t=17924) suggests that it has had some such capabilities …which have presumably been removed?
…and XnView apparently allows/allowed you to choose multiple tags, but only with OR, and not AND (viewtopic.php?t=21338 To quote from the thread "When I click on few categories the application shows all images which have ANY of the selected categories."
Back to how it would be easy to do:
Boolean operators have always been fundamental to all programming languages, and have been widely used in programs, right from the start
It would be easy to simply have a filter/search-bar, where you write in the tags and use boolean operators. (with the same autocompletion suggestions for tags, that you get in the "Categories"-panel [in the bar I've circled in the attached image] …except without the option of creating new tags, of course)
It would work perfectly well.
Like so:
To including [tag1] and [tag2], but exclude [tag3]:
[tag1] AND [tag2] NOT [tag3]
To search/filter for images with [tag1] and/or [tag2]
[tag1] OR [tag2]
To search/filter for images with [tag1] or [tag2], but not both
[tag1] XOR [tag2]
…and I'd suggest the ability to use of parentheses, as well.
Such as if you want images with [tag1] as well as one of the additional tags of [tag2] or [tag3] (but not both). That is images that have [tag1] and [tag2], or [tag1] and [tag3] (but not both [tag2] and [tag3]):
[tag1] AND ([tag2] XOR [tag3])
Some may now suspect, that using parentheses would cause a problem, due to some tags having parentheses in their name …but that wouldn't be a problem.
After all, what one writes in the filter/search-bar, could not possibly be treated by the program, as a simple text-string, with the text as one has written it.
After all, one can have several different tags, with the same name!
Writing the name of a tag, and just having that as simple text, to represent it, would create a conflict with the different tags with that same name. The program would not be able to distinguish which one is meant.
The autocompletion suggestions for tags, as in the "Categories"-panel (again: in the bar I've circled in the attached image), is an obvious neccesity, to identity the exact tag one means. Hence the tags have to be identified and then input in the filter/search-bar, as a distinct entity. (so the program would have to treat it as a separate and distinct entity, from the boolean operators and parentheses)
That said, it would be good to be able to search for tags with the same name, or (using wildcards) tags that have something as part of their name.
Of course, rather than using AND, NOT, OR, and XOR, you could choose to make it more intuitive and quick, and instead use '+' before tags to include, and '-' in front or those to exclude.
Use of parentheses would be exactly the same, of course (and their use is familiar to anyone with a bit of elementary school maths)
…but I'm not sure what characters would work best as replacements for OR and XOR, though. (maybe best to just keep those as OR and XOR?)
Like so:
To including [tag1] and [tag2], but exclude [tag3]:
+[tag1] +[tag2] -[tag3]
To search/filter for images with [tag1] and/or [tag2]
[tag1] OR [tag2]
To search/filter for images with [tag1] or [tag2], but not both
[tag1] XOR [tag2]
If you want images with [tag1] as well as one of the additional tags of [tag2] or [tag3] (but not both):
+[tag1] +([tag2] XOR [tag3])
Another thing that should added to the search/filter-bar, would be setting its scope:
All images in the catalogue, or a set folder …or multiple folders. (with options for including sub-folders, and when including subfolder, also having the option to exclude specific sub-folders)
Also, in addition to the search/filter-bar, having a panel that looks more or less like the "Categories"-panel, that can be used to choose tags for the search/filter-bar, would be a nice option.
Where the "Categories"-panel lets you press boxes, to set the tags of the selected image(s), this panel would have you press boxes to include tags in the search bar …and press the box again, to sets the tag to be excluded instead. (a third press, removing it from the search/filter-bar)
Naturally, any OR, XOR, and/or parentheses would have to be adjusted in the search/filter-bar, rather than in the panel.
Adding that panel, should be very easy, as it would, in large part, be a copy of the existing "Categories"-panel. (they would just need something to set it apart, visually, to avoid confusing them for each other)
As for where to place the search/filter-bar…
Putting in a down arrow (as on the layout menu on the toolbar, or to the right of the circled area in the attached image) on the "quick search"-bar, to allow one to switch between quick search and tag search/filtering. (or quick search, what XnView calls categories, embedded/sidecar tags, and categories+embedded/sidecar-tags)