Bug 147429 - "and not" option in search function
Summary: "and not" option in search function
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Searches-Advanced (show other bugs)
Version: 0.9.1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-01 20:58 UTC by Warren Werner
Modified: 2019-12-28 06:24 UTC (History)
1 user (show)

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


Attachments
Add "And not" for searches (6.74 KB, patch)
2007-07-02 00:02 UTC, Arnd Baecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Warren Werner 2007-07-01 20:58:49 UTC
Version:           0.9.1 (using KDE 3.5.6, Kubuntu (feisty) 4:3.5.6-0ubuntu14)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.20-16-generic

If the search function near the options "AND" "OR" had also the option "NOT", the search function would be much more flexible and the second option (contains, doesnt contain, is, is not) which depends from the filter (picture date, keyword...) would be simplier.

By the way: the way to change the "AND" "OR" (doubleklick) in my opinion is not the optimal resolution. Maybe a drop-down-list were better.
Comment 1 Arnd Baecker 2007-07-01 23:22:44 UTC
Interesting, I did not even know that a double click was possible
on that static looking text!
Comment 2 Arnd Baecker 2007-07-02 00:02:55 UTC
Created attachment 21010 [details]
Add "And not" for searches

Attached is a patch which adds "And not" as third operation.
Please give it thorough test!

Best, Arnd
Comment 3 Warren Werner 2007-07-03 15:53:46 UTC
Sorry, I have not a glue how to use this patch. I'm not a programmer, I'm a meek user. 
Comment 4 Arnd Baecker 2007-07-03 16:05:27 UTC
Well, you would have to compile from source,
and before actually doing the compile, apply the patch,
in the right directory, e.g. by
  patch < name_of_the_patch_file.patch

If you are interested in doing this, have a look at:
  http://www.digikam.org/?q=download/svn
(under "Install digiKam in your Home Directory")
However, I perfectly understand, if you don't feel up to that task ;-)

Independent of this the general procedure is:
someone of the main developers
has to look at the patch, decide if it is technically
ok, and if so, it might get applied.

Best, Arnd
Comment 5 Gerhard Kulzer 2007-08-17 14:30:45 UTC
I think this wish can be closed as it is implemented (and in a more flexible way). 
Now you can add 'As well as' which is a logical AND combined with a 'Not equal'

Best regards
Gerhard
Comment 6 Arnd Baecker 2007-08-30 15:46:43 UTC
The only situation in which an "AND NOT" could be helpful
is when combining several blocks of searches.

Josef, independent of this, does 0.9.2 work fine for you,
or do we still need the "AND NOT"?
Comment 7 Arnd Baecker 2007-10-19 10:15:34 UTC
Josef, Gerhard: what should be done with this bug/patch - close or apply or ...?
Comment 8 Warren Werner 2007-10-19 11:13:18 UTC
I think we can close it.
You can combine several blocks with 
"and" and "not equal"
 instead of 
"and not" and "is equal"

It is the same.
Comment 9 caulier.gilles 2007-10-19 11:22:28 UTC
Arnd,

The patch is not yet applied to svn. Please unforget to do it before to close this file...

Gilles
Comment 10 Arnd Baecker 2007-10-19 11:41:27 UTC
Gilles, I am not sure: 
- if I understand Josef correctly, he says that the patch is not needed.
- However, I think that an "AND NOT" is be helpful
  when combining several blocks of searches. 
  (Josef, Gerhard: I think this can be different from ``"and" and "not equal"'')
Concrete example for a search:
 Album Name Contains   Test
 As well as                           
 [ Tag Equals    testtag                ]
 [  Or                                  ]
 [  Image Date    after   03/08/2005    ]
where the [ ...] indicates grouping.
In this case replacing "As well as" by "And not" would give a different
query, which is otherwise not (easily) obtainable.
((Well, there is one small problem: the "As well as" cannot be changed 
by double clicking, in contrast to the "Or"))

So from my point of view the patch does add additional
functionality
(but of course I could be screwed in the logic here ;-)

Arnd
Comment 11 caulier.gilles 2007-10-19 12:00:27 UTC
Right. Sorry for the sound...

Gilles
Comment 12 Gerhard Kulzer 2007-10-30 18:37:06 UTC
Reply to #10, Arnd:
You cited example can be done with the current implementation:
Album Name Contains   Test 
  AND NOT                           
  [ Tag Equals    testtag                ] 
  [  Or                                  ] 
  [  Image Date    after   03/08/2005    ]
                                                ==
Album Name Contains   Test 
  As well as                           
  [ Tag Not equal    testtag                ] 
  [  Or                                   ] 
  [  Image Date    before   03/08/2005    ]

Or am i mistaken?
Gerhard
Comment 13 Arnd Baecker 2007-10-30 19:03:25 UTC
Gerhard, 

of course you are right. This variant was what I referred to
by "otherwise not (easily) obtainable". Any logical statement
can be manipulated similarly to the example. For more complicated
cases it might take some time until one has the logic right ;-)

So this is the only reason I find why an "AND NOT" might be useful.
However, I am not saying that it should be applied in svn.
Presumably the best is to let this wish sleep until it comes up
again (if at all) and reconsider then .. ;-)


Comment 14 Gerhard Kulzer 2007-10-31 14:09:32 UTC
So let's say we don't apply to 0.9.3 and you keep the patch at the side just in case.
Comment 15 caulier.gilles 2019-12-28 06:24:54 UTC
Not reproducible with 7.0.0-beta1