Bug 183425 - Advanced search by tags : "any tags" option does not work
Summary: Advanced search by tags : "any tags" option does not work
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (show other bugs)
Version: 3.5.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-06 14:22 UTC by Nadav Kavalerchik
Modified: 2017-08-18 06:29 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.6.0
Sentry Crash Report:


Attachments
Use field operator for tagid in-tree search (805 bytes, patch)
2009-09-27 19:39 UTC, Marcel Wiesweg
Details
Draft for applicable operations on chosen tags in extended search (97.65 KB, image/png)
2017-04-05 15:02 UTC, Mario Frank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nadav Kavalerchik 2009-02-06 14:22:49 UTC
Version:           0.10.0-rc1 (using 4.2.00 (KDE 4.2.0), Debian packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.26-1-amd64

i have selected several tags and expected them to narrow down the search as if a logical AND is between them when i choose "Meet All..." but it behaves like there is a logical OR (Meet any...)
Comment 1 Marcel Wiesweg 2009-02-07 14:37:52 UTC
Yes that's a feature.
It's not clear from the UI if it's AND or OR. In the tags filter sidebar this can be adjusted via context menu
Marking as wish to add UI option (along the same line as right sidebar filter; share settings??) in the future. Not 0.10.0, for technical reasons as well.
Comment 2 Paul 2009-08-10 15:55:15 UTC
Hello:

Digikam version 1.0.0-beta1 with KDE 4.3.00, Ubuntu Jaunty.Search related:

Advanced search with 1 search group and "Meet all of the following conditions":

Return pictures with 2 or more tags give the "OR" condition and not the "AND" condition. 

In other words:
The result is all the pictures with OR [tag1] OR [tag2] instead of all the
pictures that have [tag1] AND [tag2].

If this is a feature, it is misleading. 
There is no easy way to select pictures with [tag1] AND [tag2]...
OTOH it is easy to select "All pictures with tag1 OR tag2" by making another search group.

Hope that this can be resolved. Selecting pictures by help of multiple tags is crucial.
Comment 3 Marcel Wiesweg 2009-09-27 19:39:22 UTC
Created attachment 37200 [details]
Use field operator for tagid in-tree search

This patch uses the field operator for the selected tag ids, which means that the Match All / Match Any choice is applied to the selected tags.

I dont feel this intuitive, the Match All / Match Any should apply for connecting the fields in different lines, and tags is one single field (think of parentheses). Compare this to albums: Here, there is no sense at all in a "Match All" connection. And if the albums combo box always uses Match Any and the tags combo box adheres to the settings it's not coherent
 For me, to make this intuitive, inside the tags combo box need to be a separate option.
Comment 4 caulier.gilles 2011-12-15 12:49:07 UTC
Nadav, Paul,

Do you see Marcel comment #3 ?

Gilles Caulier
Comment 5 Nadav Kavalerchik 2011-12-15 14:57:11 UTC
Hi Gilles :-)

I saw Marcel's comment.

To me, what seems intuitive is...
Clicking a TAG from a listbox and then it shows on a textbox list of TAGS with a tiny sign in front of it ( plus/minus sign ) and a tiny "X" sign at the end of the TAG. 

clicking the TAG switches between + (AND) and - (NOT) and clicking the "X" removes the TAG.

Not sure what to do about the OR option.

Example:
+FLOWERS(x) +ECO(x) -BLUE(x)
Comment 6 Marcel Wiesweg 2011-12-25 11:37:43 UTC
There's still a lot which can be improved here.
Comment 7 C Doe 2013-08-08 16:37:43 UTC
This is clearly a bug.  The fact that the search options for a search group say "Meet All of the following conditions" means it should do just that, and all selected tags and all selected albums should be combined with AND.  Any other behavior is clearly a bug.  If one wants OR, there are other options to do that, either using "Meet Any..." or using additional search groups.  Am I missing something here?!
Comment 8 C Doe 2013-08-08 16:47:58 UTC
P.S.  It would be nice if the left-hand tags pane allowed one to select multiple tags simultaneously -- combining them with AND -- by using Ctrl-MouseClick.  This is a feature in many treeview widgets in many frameworks and would be very useful.  Same with left-hand album pane, to select multiple albums.
Comment 9 C Doe 2013-08-08 16:57:30 UTC
....Aaaaahhhhh...  I am missing something here...  I see the problem with tags vs albums, and with AND vs OR.  I think intuitively one expects albums to be combined with OR because another interpretation doesn't make sense.  But when the search group says "Meet All of the following conditions" and you select multiple tags, one expects the tags to be combined with AND.  At least, that's what I would consider to be intuitive, and that's what I would vote for.
Comment 10 caulier.gilles 2013-08-08 17:09:45 UTC
To comment #8 : Multiple selection of tag is already implemented through this GSoC 2013 project :

http://community.kde.org/Digikam/GSoC2013#digiKam_Tag_Manager

Gilles Caulier
Comment 11 C Doe 2013-08-08 17:29:08 UTC
When the search group says "Meet All of the following conditions", the checkboxes allowing one to select multiple albums shouldn't even exist.  The album pull-down should only allow one selection.
Comment 12 caulier.gilles 2014-08-31 08:57:48 UTC
C Doe,

What's the status of this file using last digiKam 4.2.0 ?

Gilles Caulier
Comment 13 C Doe 2014-09-02 16:10:41 UTC
I'm still using 3.x under Ubuntu Trusty.  Not sure if I can install 4.x
Comment 14 caulier.gilles 2015-05-16 12:55:52 UTC
C Doe, Nadav, Paul,

This file still valid using digiKam 4.10.0 ?

Gilles Caulier
Comment 15 caulier.gilles 2015-06-29 17:47:13 UTC
New digiKam 4.11.0 is available with official PKG installer for OSX.

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?

Gilles Caulier
Comment 16 C Doe 2015-07-02 17:49:12 UTC
What was the final decision on whether this is a bug or a feature, and if a bug, what to do about it?
Comment 17 caulier.gilles 2015-07-02 21:40:02 UTC
C Doe,

The question is : problem still reproducible with recent release ?

Gilles Caulier
Comment 18 C Doe 2015-07-03 03:18:22 UTC
The problem is still reproducible in digiKam 3.5.0 on Ubuntu.  Haven't been able to test the most recent release.
Comment 19 caulier.gilles 2016-11-26 09:50:00 UTC
This problem still reproducible using digiKam AppImage bundle 5.4.0 pre release ?

It available at this url :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Gilles Caulier
Comment 20 Mario Frank 2017-04-05 15:02:24 UTC
Created attachment 104891 [details]
Draft for applicable operations on chosen tags in extended search

For tags, the user can select if the images to find must be in all the chosen tags or at least in one.

The patch will be uploaded here: https://bugs.kde.org/show_bug.cgi?id=353331
Comment 21 Mario Frank 2017-04-11 17:31:41 UTC
Git commit 660782be8137d8448ef10e5e944a2dd213d781cc by Mario Frank.
Committed on 11/04/2017 at 17:27.
Pushed by mfrank into branch 'master'.

Added an overall improvement of fuzzy, duplicates and extended search.
1) Users can now restrict the results of fuzzy image/drop/sketch search to be in specific albums.
2) Users can now select both tags and albums in duplicates search and restrict the set of images in which duplicates are searched with logical operations (in selected albums or/and tags, in selected albums but not tags and vice versa and only in
selected objects of current tab)
3) In extended search, the tags selection can also be restricted such that images must be either tagged with at least one of or with all selected tags.
Related: bug 353331, bug 300565

M  +7    -1    NEWS
M  +31   -3    app/utils/searchmodificationhelper.cpp
M  +11   -0    app/utils/searchmodificationhelper.h
A  +307  -0    libs/album/albumselectioncomponent.cpp     [License: UNKNOWN]  *
A  +121  -0    libs/album/albumselectioncomponent.h     [License: GPL (v2+)]
M  +248  -173  libs/album/albumselectors.cpp
M  +34   -19   libs/album/albumselectors.h
M  +7    -0    libs/database/coredb/coredbsearchxml.cpp
M  +1    -0    libs/database/coredb/coredbsearchxml.h
M  +1    -0    libs/database/dbjobs/dbjob.cpp
M  +11   -0    libs/database/dbjobs/dbjobinfo.cpp
M  +4    -0    libs/database/dbjobs/dbjobinfo.h
M  +119  -30   libs/database/haar/haariface.cpp
M  +30   -8    libs/database/haar/haariface.h
M  +32   -10   libs/database/item/imagelister.cpp
M  +44   -0    libs/database/item/imagequerybuilder.cpp
M  +6    -4    libs/settings/applicationsettings.cpp
M  +3    -0    libs/settings/applicationsettings.h
M  +11   -0    libs/settings/applicationsettings_miscs.cpp
M  +1    -0    libs/settings/applicationsettings_p.cpp
M  +2    -0    libs/settings/applicationsettings_p.h
M  +1    -1    utilities/facemanagement/facescandialog.cpp
M  +69   -22   utilities/fuzzysearch/findduplicatesview.cpp
M  +83   -21   utilities/fuzzysearch/fuzzysearchview.cpp
M  +1    -0    utilities/fuzzysearch/fuzzysearchview.h
M  +6    -1    utilities/maintenance/duplicatesfinder.cpp
M  +1    -1    utilities/maintenance/duplicatesfinder.h
M  +4    -4    utilities/maintenance/maintenancedlg.cpp
M  +2    -1    utilities/maintenance/maintenancemngr.cpp
M  +72   -27   utilities/searchwindow/searchfields.cpp
M  +18   -4    utilities/searchwindow/searchfields.h

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


https://commits.kde.org/digikam/660782be8137d8448ef10e5e944a2dd213d781cc