diff --git a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogSearch.h b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogSearch.h index 5f33e9d4b73d4e3e259d36c1d4b52deb3cb6fe56..1b530f932c143be21b2dfc1ff4868971363e8f33 100644 --- a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogSearch.h +++ b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogSearch.h @@ -60,16 +60,14 @@ namespace Mantid ~CatalogSearch() {} /// Algorithm's name for identification overriding a virtual method virtual const std::string name() const { return "CatalogSearch"; } - ///Summary of algorithms purpose - virtual const std::string summary() const {return "Searches investigations in the catalog using the properties set.";} - + ///Summary of algorithms purpose + virtual const std::string summary() const { return "Searches all active catalogs using the provided input parameters."; } /// Algorithm's version for identification overriding a virtual method virtual int version() const { return 1; } /// Algorithm's category for identification overriding a virtual method virtual const std::string category() const { return "DataHandling\\Catalog"; } private: - /// Overwrites Algorithm init method. void init(); /// Overwrites Algorithm exec method diff --git a/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp b/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp index a25355b46ffa7e1232021854cb4af49b4c0b361f..fd7d3456550a244199ef1f6d9aeb23b4d77f96b3 100644 --- a/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp +++ b/Code/Mantid/Framework/ICat/src/CatalogSearch.cpp @@ -33,7 +33,7 @@ namespace Mantid declareProperty("StartDate","", isDate, "The start date for the range of investigations to be searched. The format must be DD/MM/YYYY."); declareProperty("EndDate","", isDate, "The end date for the range of investigations to be searched. The format must be DD/MM/YYYY."); declareProperty("Keywords","","A comma separated list of words to search for in the investigation."); - declareProperty("InvestigationId","","The ID of the investigation. Also known as: "); + declareProperty("InvestigationId","","The ID of the investigation."); declareProperty("InvestigatorSurname", "", "The surname of the investigator associated to the investigation."); declareProperty("SampleName", "", "The name of the sample used in the investigation."); declareProperty("DataFileName","", "The name of the data file in the investigation."); diff --git a/Code/Mantid/docs/source/algorithms/CatalogSearch-v1.rst b/Code/Mantid/docs/source/algorithms/CatalogSearch-v1.rst index e1bd742e97a55861e89022de3f00e15080a7f859..82e519581d2e8176e64737d39f8e0351ba556d53 100644 --- a/Code/Mantid/docs/source/algorithms/CatalogSearch-v1.rst +++ b/Code/Mantid/docs/source/algorithms/CatalogSearch-v1.rst @@ -9,7 +9,58 @@ Description ----------- -This algorithm searches for the investigations and stores the search -results in a table workspace. +This algorithm searches through the all active catalogs for investigations based on the parameters set, and saves the results into a workspace. + +Usage +----- + +**Example - searches for investigations in the catalog based on parameters set.** + +.. code:: python + + # When logging into the catalog the session class is returned. + # This can then be used throughout to perform other ICAT routines. + search_results = CatalogSearch(Instrument="ALF",limit=3) + + # A tuple is returned from CatalogSearch(). The first item is the search results. + investigations = search_results[0] + + print "The number of investigations returned was: " + str(len(investigations)) + + # Print the title of all returned investigations. + for investigation in investigations: + print "The title of the investigation is: " + investigation['Title'] + + # Log out of the catalog, otherwise results are appended to the workspace (search_results). + CatalogLogout() + +Output: + +.. code:: python + + The number of investigations returned was: 3 + + The title of the investigation is: CAL_ALF_14/02/2014 15:37:05 + The title of the investigation is: CAL_ALF_18/11/2013 15:03:48 + The title of the investigation is: CAL_ALF_19/11/2013 11:59:56 + +**Example - paging results returned.** + +.. code:: python + + # When CountOnly is set to True a separate COUNT query is performed to see the total + # number of investigations that will be returned by this search. This is used for paging functionality. + # If CountOnly is not provided, then ALL results are returned. This can be extremely slow. + search_results = CatalogSearch(Instrument="ALF",CountOnly=True,StartDate="03/06/2012", EndDate="03/06/2014") + + print "The number of search results returned was: " + str(search_results[1]) + + CatalogLogout() + +Output: + +.. code:: python + + The number of search results returned was: 109 .. categories::