forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: taraAthan on January 04, 2008, 06:28:47 pm

Title: keyword AND in $source
Post by: taraAthan on January 04, 2008, 06:28:47 pm
I would like to search for two or more keywords with an AND option instead of OR. That is: match all of these keywords.  I was wondering if anyone has modified the cpmfetch code to do this (before I attempt to do it myself).

Thanks, Tara
Title: Re: keyword AND in $source
Post by: taraAthan on January 05, 2008, 01:01:16 am
Okay, I made the modifications to add an option to "match all of these keywords".  It wasn't too hard, as the code in cpmfetch is well-written and easy to follow   ;D. The only file that had to be modified was cpmfetch_dao.php - the modified file is attached as a zip.

My solution is perhaps not very elegant- I just added a new option to the $source parameter called keywordand. It works basically the same way as keyword, but puts ANDS in between instead of OR. You can still have the OR style keyword search as well, so it is possible to construct a complex keyword query that looks like this

keywords like  a OR b OR (x AND y AND z)

although I'm not sure why you would want to do that ???

In case you are interested, I am using this for a faceted search, where I have keywords such as
event.Ludwigia_field_tour and ecotype.riparian_woodland.  The part before the . is the name of the facet.
Title: Re: keyword AND in $source
Post by: vuud on January 06, 2008, 11:40:06 pm
Okay, I made the modifications to add an option to "match all of these keywords".  It wasn't too hard, as the code in cpmfetch is well-written and easy to follow   ;D. The only file that had to be modified was cpmfetch_dao.php - the modified file is attached as a zip.

My solution is perhaps not very elegant- I just added a new option to the $source parameter called keywordand. It works basically the same way as keyword, but puts ANDS in between instead of OR. You can still have the OR style keyword search as well, so it is possible to construct a complex keyword query that looks like this

keywords like  a OR b OR (x AND y AND z)

although I'm not sure why you would want to do that ???

In case you are interested, I am using this for a faceted search, where I have keywords such as
event.Ludwigia_field_tour and ecotype.riparian_woodland.  The part before the . is the name of the facet.

Interesting... thanks for posting!

Vuud
Title: Re: keyword AND in $source
Post by: cambiasso on November 28, 2009, 04:14:28 pm
Okay, I made the modifications to add an option to "match all of these keywords". 

I Love You !!!!  :-*  :-*

GRAZIE!!!!  ;)