We're Hiring!

How to import a file and search it by its keywords?

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

How to import a file and search it by its keywords?

Postby pz3977 » Fri Sep 19, 2014 7:45 am

Hi,

This is my first time that I want to import a file using omero.insight and then search by its metadata. I managed to import a file, however, I could not find it even by searching its name.

I imported a sample file called "tubhiswt_C0.ome.tif"

Then I tried to find it using the following code:

Code: Select all
for i in conn.searchObjects(["Image"], "tubhiswt"):
   print i.getId(), i.getName()


But it could not find any result. Could you please help me with that.
Another question is that how I can label this file with other keywords which can be searched by the above mentioned code? I tried to use annotations but it did not work.

Best regards,
pz3977
pz3977
 
Posts: 31
Joined: Thu Jul 10, 2014 11:39 am

Re: How to import a file and search it by its keywords?

Postby atarkowska » Fri Sep 19, 2014 8:48 am

Hi,

All metadata indexed during the import process should be widely searchable. Will wrote some nice examples of how to use search here

Which omero version are you using?
Did you try to search using OMERO.web? How results are different from your script?
With the search phrase did you follow tips from our search help page

Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: How to import a file and search it by its keywords?

Postby pz3977 » Tue Sep 23, 2014 10:19 am

Hi Ola,

Thanks for your reply. I think the problem is about the way I have imported , I cannot even find it by search via webclient. I can see my file in the folder which I imported but the result of search returns nothing when I tried to search by its extension or part of its name. (I have already read the tips for search)

How can I check the problem?

Regards,
Parisa
pz3977
 
Posts: 31
Joined: Thu Jul 10, 2014 11:39 am

Re: How to import a file and search it by its keywords?

Postby atarkowska » Tue Sep 23, 2014 10:31 am

How did you import the file?

Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: How to import a file and search it by its keywords?

Postby pz3977 » Tue Sep 23, 2014 10:44 am

I import it via web.insight. I tried to follow the instruction on the web. I created a data set and import a file. Nothing special!

When I check it in web.client I can see it in my folder but I cannot search it :(
pz3977
 
Posts: 31
Joined: Thu Jul 10, 2014 11:39 am

Re: How to import a file and search it by its keywords?

Postby atarkowska » Tue Sep 23, 2014 12:01 pm

Could you please provide me with more detail about your OMERO instance?
- Which version is that?

- Could you please also send me an output of the console when you run
Code: Select all
bin/omero admin diagnostics

- All logfiles from OMERO_DIR/var/log
- Name of the file, full path on your hard-drive where you were importing from, and roughly the time when you were searching.

Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: How to import a file and search it by its keywords?

Postby pz3977 » Tue Sep 23, 2014 1:17 pm

Hi Ola,
Here you can find the output of console:

Code: Select all
================================================================================
OMERO Diagnostics 5.0.3-ice34-b41
================================================================================
       
WARNING:omero.util.UpgradeCheck:UPGRADE AVAILABLE:Please upgrade to 5.0.4 See http://trac.openmicroscopy.org.uk/omero for the latest version

Commands:   java -version                  1.7.0     (/usr/bin/java -- 2 others)
Commands:   python -V                      2.7.3     (/usr/bin/python)
Commands:   icegridnode --version          3.4.2     (/usr/bin/icegridnode)
Commands:   icegridadmin --version         3.4.2     (/usr/bin/icegridadmin)
Commands:   psql --version                 not found

Server:     icegridnode                    not started

Cannot list deployed applications.

Log dir:    /home/nspyre/DSTFiles/DataSources/OMERO.py/var/log exists

Log files:  Blitz-0.log                    n/a
Log files:  DropBox.log                    n/a
Log files:  FileServer.log                 n/a
Log files:  Indexer-0.log                  n/a
Log files:  MonitorServer.log              n/a
Log files:  OMEROweb.log                   n/a
Log files:  Processor-0.log                n/a
Log files:  Tables-0.log                   n/a
Log files:  TestDropBox.log                n/a
Log files:  Total size                     0.00 MB

Error while parsing logs

Environment:OMERO_HOME=(unset)             
Environment:OMERO_NODE=(unset)             
Environment:OMERO_MASTER=(unset)           
Environment:OMERO_TEMPDIR=(unset)         
Environment:PATH=/home/nspyre/Projects/nChain/bin:/home/nspyre/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gameS:/home/nspyre/bin:/usr/local/java/jdk1.7.0_60/bin:/home/nspyre/bin:/usr/local/java/jdk1.7.0_60/jre/bin:/usr/local/java/jdk1.7.0_60
Environment:PYTHONPATH=(unset)             
Environment:ICE_HOME=/usr/share/Ice-3.4.2 
Environment:LD_LIBRARY_PATH=(unset)       
Environment:DYLD_LIBRARY_PATH=(unset)     

OMERO data dir: '/OMERO'   Exists? False   Is writable? False
OMERO temp dir: '/home/nspyre/omero/tmp'   Exists? True   Is writable? True   (Size: 0)
OMERO.web status... [NOT STARTED]


It could not make any log file!
The name of the file is:
actin_tubhiswt_C0.ome.tif
I cannot remember of the full path, I guess it was on D drive and I was searching now again, 3:16 23/09/2014
pz3977
 
Posts: 31
Joined: Thu Jul 10, 2014 11:39 am

Re: How to import a file and search it by its keywords?

Postby atarkowska » Wed Sep 24, 2014 8:27 am

Hi,

From what I can see I understand that you use OMERO.py locally to connect to the remote server. I need logs from the remote server where your image was imported.

Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: How to import a file and search it by its keywords?

Postby wmoore » Wed Sep 24, 2014 9:36 am

It's possible that your search index is corrupted and/or that indexing is not happening on import.

If you monitor the Indexer log when you import an image, you should see some activity when import completes. E.g.

Code: Select all
# On the OMERO server, follow the Indexer log

$ tail -f var/log/Indexer-0.log


E.g. On import of a single tiff file, I see this in the Indexer log:
Code: Select all

2014-09-24 10:23:37,519 INFO  [   ome.services.fulltext.FullTextIndexer] (2-thread-5) INDEXED    2 objects in batch#1770   [   1490 ms.]  ~99% done (173657 of 173663)
2014-09-24 10:24:38,534 INFO  [                      ome.system.metrics] (r-thread-1) type=HISTOGRAM, name=ome.services.fulltext.FullTextIndexer.percentCompleteFast, count=1, min=99, max=99, mean=99.0, stddev=0.0, median=99.0, p75=99.0, p95=99.0, p98=99.0, p99=99.0, p999=99.0
2014-09-24 10:24:38,562 INFO  [                      ome.system.metrics] (r-thread-1) type=HISTOGRAM, name=ome.services.fulltext.FullTextIndexer.percentCompleteSlow, count=0, min=0, max=0, mean=0.0, stddev=0.0, median=0.0, p75=0.0, p95=0.0, p98=0.0, p99=0.0, p999=0.0
2014-09-24 10:24:38,564 INFO  [                      ome.system.metrics] (r-thread-1) type=TIMER, name=ome.services.fulltext.FullTextIndexer.batch, count=1801, min=1.056, max=1490.08, mean=3.7655953307392998, stddev=46.41417620151305, median=2.392, p75=2.775, p95=3.3418499999999995



You may need to re-build your search index as described here: https://www.openmicroscopy.org/site/sup ... reindexing

This can take some time, but background re-indexing can occur without needing to take the server off-line. This should ensure that search indexing starts to work again.

Hope that helps,

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest