forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: peterlustig on October 27, 2010, 05:10:35 pm

Title: Search excluding certain keyword(s)
Post by: peterlustig on October 27, 2010, 05:10:35 pm
Dear all,

in my keywords I have peoples' names tagged. Is there a possibility to perform a search for photos with Susan and Mike but not Charly in it?

It seems you have to know how to handle regular expressions -- I don't. According to this page http://stackoverflow.com/questions/3883985/vim-regex-how-to-search-for-a-and-b-not-c (http://stackoverflow.com/questions/3883985/vim-regex-how-to-search-for-a-and-b-not-c) the syntax should be something like

\v^(.*Susan)&(.*Mike)&(.*Charly)@!


But this doesn't yield any results. Any help would be greatly appreciated.

Cheers, Peter
Title: Re: Search excluding certain keyword(s)
Post by: Αndré on October 29, 2010, 10:19:35 am
\v^(.*Susan)&(.*Mike)&(.*Charly)@!
Where do you enter that? You cannot enter that in Coppermine's search form.
Title: Re: Search excluding certain keyword(s)
Post by: peterlustig on October 29, 2010, 01:43:50 pm
ok, then I misunderstood the new search feature

I gathered from the "Match regular expressions" option in the Search function's dropdown that regular expressions could be used to search the database. In fact, I was just looking for a way to perform searches like 

A AND (B OR C)
(A AND B) NOT (C OR D)

or something similar, and that seems too complicated for the other to dropdown-options of "Match all words (AND)" and "Match any words (OR)".

If "Match regular expressions" cannot be used like this -- which functionality does it add?
Title: Re: Search excluding certain keyword(s)
Post by: Αndré on October 29, 2010, 01:46:37 pm
Oops, sorry. I forgot that we have this option. Will have a look.
Title: Re: Search excluding certain keyword(s)
Post by: Αndré on October 29, 2010, 02:02:44 pm
I'm not sure if that syntax can be used in PHP / MySQL. The MySQL regex function (http://dev.mysql.com/doc/refman/5.1/de/regexp.html) seems to support only basic regular expressions.
Title: Re: Search excluding certain keyword(s)
Post by: peterlustig on October 29, 2010, 05:15:06 pm
ok, thanks for the hint. seems to me then that there is no operator for negating/excluding a string from the search