[ome-users] Substring search?

Josiah Johnston siah at nih.gov
Mon Oct 17 19:52:09 BST 2005


Are you still dealing with this problem? I can't recreate it. Here's  
what I did:

In the image detail page (what you see when you click on an image  
name), I entered "foo,fie,foe,fum" in the "Current Textual Annotation"  
text box, and hit "Save". I did the same to two other images with  
"foo,foe,fum" and "fie,fum".

I went to Search -> Other, then chose to look for "ImageAnnotation". I  
saw all three entries, plus some old ones.
I searched for "foo" in the Content and got 0 results.
"*foo*" returned 1 and 2
"foo*" also returned 1 and 2
"fie*" returned 3
"*fie*" returned 1 and 3

If this is not the behavior you are getting, then something unexpected  
is going on.
I tested this on 2.4.0 running postgresql 7.2.2
and on a slightly old version of cvs-HEAD running 7.3.4-RH

These four queries get translated to roughly:
select * from image_annotations where content ilike '%foo%';
... ilike 'foo%';
... ilike 'fie%';
... ilike '%fie%';

I get the same results in the DB as through the Web interface. e.g.
ome=# select * from image_annotations where content ilike 'fie%';
  attribute_id | image_id | content | the_c | the_t |  
module_execution_id | the_z | valid
--------------+----------+---------+-------+------- 
+---------------------+-------+-------
        352112 |     6864 | fie,fum |       |       |                
37182 |       | t
(1 row)

If you still are having this problem, can you report what the database  
queries return?

Thanks,
-Josiah

On Aug 6, 2005, at 6:58 AM, Graham Klyne wrote:

> I was showing OME to a new potential user yesterday, and a question  
> came up that required searching for the occurrence of a substring  
> *within* a string value in a new Semantic Type.
>
> So if we have entries with fields containing:
>  1.  "foo,fie,foe,fum"
>  2.  "foo,foe,fum"
>  3.  "fie,fum"
> a search for "fie" would return the entries 1 and 3.
>
> With a little experimentation, I found that I could use a wildcard to  
> match leading substrings (e.g. searching for "foo*" would return 1 and  
> 2 above) but the searching for "*fie*" didn't work.
>
> My question is:  is there a feature I'm overlooking that does this in  
> the UI?  (I'm fairly sure this could be done at the database level  
> using postgres regexp matching.)
>
> (This use of substring matching would be an interim "fix" until a more  
> structured approach to organizing the data could be adopted, so I'm  
> not suggesting here that it should be regarded as a priority feature  
> request.)
>
> #g
>
> -- 
> Graham Klyne
> Image Bioinformatics Research Group (http://www.bioimage.org/)
> Department of Zoology, University of Oxford
> South Parks Road, Oxford OX1 3PS, UK
> E-mail: <Graham.Klyne at zoo.ox.ac.uk>
> Direct phone: +44-(0)1865-281991
> Departmental fax: +44-(0)1865-310447
>
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>




More information about the ome-users mailing list