[ic] Custom SearchOP SOLVED

Tom Tucker tom at ttucker.com
Tue Sep 11 00:58:11 EDT 2007


Kevin Walsh wrote:
> Tom Tucker <tom at ttucker.com> wrote:
>   
>> I am using "Mike Heins' modified foundation demo" from 2003. Added a 
>> column for model to the products table (VARCHAR 64). The abridged 
>> dataset I am searching through looks like this:
>>
>> sku        model  prod_group  Category      
>> ---------  -----  ----------  --------
>> MRD_CD5    65-73  Mustang     RADIO
>> MRD_CD6    65-73  Mustang     RADIO
>> M_5482A    65-66  Mustang     RADIO
>> MRD_103    65-66  Mustang     RADIO
>> MRD_105CD  65-66  Mustang     RADIO
>> MRD_1601   65-66  Mustang     RADIO
>> MRD_1501   65-66  Mustang     RADIO
>> MRD_12000  65-66  Mustang     RADIO
>> MRD_105    65-66  Mustang     RADIO
>> MRD_106    65-66  Mustang     RADIO
>> MRD_106CD  65-66  Mustang     RADIO
>> MRD_S06    65-73  Mustang     RADIO
>> MRD_101    65-66  Mustang     RADIO
>> MRD_107    65-66  Mustang     RADIO
>> MRD_107CD  65-66  Mustang     RADIO
>> MRD_108    65-66  Mustang     RADIO
>> M_5482C    65-73  Mustang     RADIO
>> MRD_S11    65-68  Mustang     RADIO
>> MRD_S12    65-73  Mustang     RADIO
>> M_5486A    65-67  Mustang     RADIO
>> MRD_CD     65-73  Mustang     RADIO
>>
>> But the scan only returns the following skus:
>> MRD_101
>> MRD_103
>> MRD_105
>> MRD_105CD
>> MRD_106
>> MRD_106CD
>> MRD_107
>> MRD_107CD
>> MRD_108
>> MRD_12000
>> MRD_1501
>> MRD_1601
>> M_5482A
>>
>> When I look at the mysql log, I see that an "active != 1" is added to 
>> the query (select * from products  WHERE inactive != 1 AND prod_group = 
>> 'Mustang' AND category = 'RADIO') and then 15 iterative selects over the 
>> 13 skus returned getting the additional product, pricing and inventory data.
>>
>>     
> "WHERE inactive != 1" will be added to the search SQL if you have a
> "HIDE_FIELD inactive" modifier defined for your table.  See here:
>
>     http://www.interchange.rtfm.info/icdocs/Database_reference_guide.html#HIDE_FIELD
>
> Do the missing rows all have their "inactive" column set to "1"?
>
> Heh - that'd be too easy.  Assuming that that is not the case, can you
> show the actual search specification you are submitting.
>
>   
>> Noting in the VENDROOT error.log nor debug.log and nothing in the 
>> CATROOT error.log. Curious that a ::logDebug in the SearchOp shows 
>> nothing in the VENDROOT debug.log.
>>
>>     
> ::logDebug won't be available for use within your (local) SeaarchOp
> code.  Use Debug() instead:
>
>     http://www.interchange.rtfm.info/icdocs/Interchange_Perl_objects.html#Debug
>
>   
>> Sorry to be so verbose
>>
>>     
> Verbose is good.
>
>   
As usual, DOH!

I was naming the CodeDef sub while the code_def routine in Util.pm code 
looks to be expecting an anonymous subroutine that it stores in the 
namespace with the name specified in CodeDef. My routine was thus never 
being called at all.

Works now. Just follow the template in catalog.cfg precisely and you 
will avoid the same frustration.

Thanks to all!

Tom



More information about the interchange-users mailing list