Copy link to clipboard
Copied
I have a cfsearch that is displaying a record that was deleted from the database weeks ago. I have run the code below and the record keeps coming up. What am I doing wrong? Here's the code:
<cfquery name="getstudents" datasource="myDatasource">
SELECT ID, fname, lname, fullName
FROM student
</cfquery>
<cfindex query="getstudents"
collection="myCollection"
action="update"
type="custom"
key="ID"
title="fullName"
body="fname, lname, fullName">
<cfsearch
collection="myCollection"
name="getStudents2"
criteria="smith"
maxrows = "100">
cfdump of getstudents returns the records with one instance of smith
cfdump of getstudents2 returns the records with two instances of smith - one of which has been deleted from the database
Copy link to clipboard
Copied
I have exactly the same issue. It's like it has the old data cached. I've even deleted the collection in the CF Admin and rebuilt it.
I normally rename the collection and rebuild it but I just found in the CF Admin that you can Purge the collection. That seems like it would fix the issue too.
Index | Analyzes the files in a collection and assembles metadata and pointers to the files. |
Optimize | Reclaims space left by deleted and changed files by consolidating collection indexes for faster searching. You should optimize collections regularly. |
Purge | Deletes all documents in a collection, but not the collection itself. Leaves the collection directory structure intact. |
Delete | Deletes a collection |