You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search: indexing never removes facet metadata it no longer extracts #3677
Indexing writes the facets it extracted into the resource's arbitrary metadata (libre.graph.photo.*, .audio.*, .image.*, .video.*, .location.*, .motionPhoto.*, .livePhoto.*), and PROPFIND serves them from there. The write merges, so a value the extraction no longer produces stays on the resource, and re-indexing never removes it.
Steps to reproduce
Upload a photo that carries EXIF and let it be indexed. PROPFIND shows oc:camera-make, oc:camera-model, oc:iso, oc:f-number, oc:taken-date-time.
Strip the metadata from that file (magick in.jpg -strip out.jpg) and upload it over the same name, which indexes it again.
PROPFIND the file.
Expected behavior
The facets the file no longer carries are gone from the resource.
Actual behavior
All of them are still served, with the values from the first upload.
Setup
doUpsertItem collects the facets the current extraction produced and hands them to SetArbitraryMetadata, which merges rather than replaces. A facet that vanished entirely does not even get that far:
iflen(metadata) ==0 {
return
}
The indexer owns a known key space, the seven prefixes and the fields of their libregraph models, so it could unset the owned keys it did not just write. Worth deciding: whether unset and set should be one call so no reader sees a half updated facet, and whether keys already written need a migration or are cleaned on the next index after the fix.
Activity