Hi Guys,
Ok, I've made alot of progress on this.
Here is where I am at.
I am trying to create several indexes for a classified ad application.
The main index will be used for searching by users. The other two will
be used by the application to search for listings that are either
'new' or 'featured'. The application will use a set of keywords to
search against the new/featured indexes and populate relative ads to
be viewed on the site.
Main Index (all listings)
New Index (listings that are less than X days old)
Featured Index (listings that have been flagged as 'featured')
When a user creates an ad, I have a script that takes all the new data
and creates the records in the index.
When a user updates an ad, I have a scrip that takes all of the
updated data, and updates the relative record in the index.
Along with a scheduled task that will clean up the new/featured
indexes once per day, I also have some cleanup done whenever someone
modifies their listing. I can update the indexes just fine, but what
I'm having trouble with is deleting individual records from the
index.
In part of the script,
I want to compare the date the ad was created, to the current date,
and do a datediff on it. If the datediff is greater than x amount of
hours (ie 72 hours), I want to query the "new listings" index for the
ad, and if there is a match, delete it from the index.
Here is a snippet of what I'm trying to do.
I just want to be able to delete a record from the Index, and I
thought the CFINDEX statement below would be correct, but I keep
getting "query must be defined" error when running it.
Is there a way to query the catalog for matches againts the KEY value?
Or can you ONLY search the body? What I have below isn't working....
<CFSEARCH NAME="check_catalog_exists" COLLECTION="new_Classifieds"
type="simple" criteria="#CID#">
<CFIF check_catalog_exists.recordcount = 1>
<cfindex
action="delete"
collection="new_classifieds"
type="custom"
key="#CID#"
title=""
URLpath=""
body=""
category =""
custom1 = ""
custom2 = ""
custom3 = ""
custom4 = ""
>
</CFIF>
--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon
mailing list - http://groups.google.com/group/openbd?hl=en
!! save a network - please trim replies before posting !!