Task #9337 (closed)
Bug: Search returns results that it should not after removing tags
| Reported by: | sylittlewood | Owned by: | jamoore |
|---|---|---|---|
| Priority: | major | Milestone: | OMERO-4.4 |
| Component: | General | Version: | n.a. |
| Keywords: | n.a. | Cc: | |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | 0.0d |
| Sprint: | n.a. |
Description
An issue was found when removing tags from an image where they were still being returned from the search query even though the tag had been removed. Suspect that the search index is not being updated when the tag is removed. Waited a few hours and preformed the search again, image still coming back in search results.
- Search for [Tag] = no results
- Annotate an image with [Tag].
- Search for [Tag] = Image found
- Remove [Tag] from the image
- Search for [Tag] = Image still found
Change History (5)
comment:1 Changed 7 years ago by jmoore
comment:2 Changed 7 years ago by jmoore
Code pushed to rc-thursday (https://github.com/openmicroscopy/openmicroscopy/pull/251). I'll apply a hot patch to howe for re-testing.
comment:3 Changed 7 years ago by jmoore
Confirmed by Elwood to be working now. Closing.
comment:4 Changed 7 years ago by jmoore
- Resolution set to fixed
- Status changed from new to closed
comment:5 Changed 7 years ago by jmoore <josh@…>
- Remaining Time set to 0
(In [be5f96a6f46164db4b3376bc4fba76497a846fcc/ome.git] on branch develop) Fix delete triggers for annotation re-indexing (Fix #9337)
After changes to the triggers, this script:
#!/usr/bin/env python # -*- coding: utf-8 -*- import time def WAIT(): print "Sleeping ",10 time.sleep(10) import sys sys.path.insert(0, "dist/lib/python") import omero import omero.gateway c = omero.client() s = c.createSession() g = omero.gateway.BlitzGateway(client_obj=c) W = g._waitOnCmd u = s.getUpdateService() S = u.saveAndReturnObject q = s.getQueryService() F = q.findAllByFullText Q = q.findAllByQuery rt = omero.rtypes.rtime rs = omero.rtypes.rstring for i in Q("select i from Image i where i.name = 'foo'", None): print "Deleting image", i.id.val W(g.deleteObjects("/Image", [i.id.val], deleteAnns=True)) for c in Q("select c from CommentAnnotation c where c.textValue in ('bar', 'baz')", None): print "Deleting comment", c.id.val W(g.deleteObjects("/Annotation", [c.id.val], deleteAnns=True)) print "Creating image...", i = omero.model.ImageI() i.acquisitionDate = rt(0) i.name = rs("foo") i = S(i) print i.id.val print "Creating comment 'bar' and linking...", c = omero.model.CommentAnnotationI() c.textValue = rs("bar") l = i.linkAnnotation(c) l = S(l) c = l.child print c.id.val def T(type, string, length=1): results = F(type, string, None) print "Found %s %s(s) for: '%s'" % (len(results), type, string) if len(results) != length: raise Exception("Found %s; Expected %s" % (len(results), length)) WAIT() T("Image", "foo") T("Image", "bar") T("CommentAnnotation", "bar") T("CommentAnnotation", "baz", length=0) print "Changing to 'baz'..." c.textValue = rs("baz") c = S(c) WAIT() T("Image", "foo") T("Image", "baz") T("CommentAnnotation", "baz") T("Image", "bar", length=0) T("CommentAnnotation", "bar", length=0) print "Changing to 'unlinking'..." u.deleteObject(l) WAIT() T("Image", "foo") T("CommentAnnotation", "baz") T("Image", "baz", length=0) T("Image", "bar", length=0) T("CommentAnnotation", "bar", length=0)is now passing:
via the appropriate REINDEX eventlogs: