Title:
<cfindex action="delete"> does not work for files that no longer exist on disk (affects: Solr).
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Martin Böhm / Martin Böhm (Martin Böhm)
Created: 07/04/2013
Components: Text Search
Versions: 10.0
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: Final / 287564
Priority/Frequency: Major / All users will encounter
Locale/System: English / Platforms All
Vote Count: 1
Problem Description:
It is not possible to delete an indexed file from a Solr collection after it has been removed on disk.
Steps to Reproduce:
- set up a Solr collection named "test"
- index a file <cfindex collection="test" action="update" type="file" key="/path/to/file">
- delete that file on disk
- use <cfindex collection="test" action="delete" key="/path/to/file" status="s">
Actual Result:
s.DELETED will be 0 and the file continues to exist in the collection
Expected Result:
s.DELETED should be 1 and the file should be removed from the index
Any Workarounds:
<cfset path = "/path/to/file">
<cfindex collection="test" action="delete" key="#path.hashCode()#" status="s">
Background Information
For <cfindex type="file"> operations ColdFusion uses the file's path.hashCode() as the Solr key instead of the path string. Once the no longer exists physically, ColdFusion falls back to sending the path to Solr. Consequence: any "update" type request that refers a file path that does not exist on disk will fail. This affects both index delete and update operations.
The use of Java's .hashCode() is completely inappropriate for this purpose. The actual path string must always be used as the Solr key.
The issue is explained in detail in this StackOverflow post. http://stackoverflow.com/a/17456337/18771
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3589991
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: _Tomalak
External Customer Email:
External Test Config: My Hardware and Environment details:
ColdFusion 10 Standard Installation
64bit Windows 2008 R2 Server
JVM 1.7.0_21 x64
Attachments:
Comments: