keyword AND in $source keyword AND in $source
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

keyword AND in $source

Started by taraAthan, January 04, 2008, 06:28:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

taraAthan

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

taraAthan

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.

vuud

Quote from: 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.

Interesting... thanks for posting!

Vuud
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

cambiasso

Quote from: taraAthan on January 05, 2008, 01:01:16 AM
Okay, I made the modifications to add an option to "match all of these keywords". 

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

GRAZIE!!!!  ;)