TEST SUITE FOR THE FORWARD INDEX MANAGEMENT-LOOKUP-UPDATER
-----------------------------------------------------------
-Authors
* Spyros Mpoutsis (s.mpoytsis@di.uoa.gr)
* Vasilis Verroios (v.verroios@di.uoa.gr)

-Build

Dependencies: gCore, org.gcube.indexmanagement.forwardindexlookup.stubs, org.gcube.indexmanagement.forwardindexmanagement.stubs, org.gcube.indexmanagement.forwardindexupdater.stubs
Compile: javac ForwardIndexClient.java VOInfoManager.java, javac Col_2_fwRowsetRS.java VOInfoManager.java

-Define the properties file

For each scope a properties file must be defined with the information about the URIs of the involved services, and the IDs, schemas and languages of the collections.
An example for this properties file is given in this test suite for scope /gcube/devsec, with the file _gcube_devsec.properties(the convention is to replace '/' with '_' in the name of the scope) 

-Run
 
  ForwardIndexClient
  
  Syntax: 
 * 1) ForwardIndexClient [ -cred <credentialFile> ] <scope> -create "manager" | "lookup" | "all" <colName> <colSchema> <colLang> <indexedFieldNumber> (<keyName> <indexTypeID>)^<indexedFieldNumber>  [ indexID ]
 * 2) ForwardIndexClient [ -cred <credentialFile> ] <scope> -destroy "manager" | "lookup" | "all" <colName> <colSchema> <colLang> <indexedFieldNumber> (<keyName>)^<indexedFieldNumber>
 * 3) ForwardIndexClient [ -cred <credentialFile> ] <scope> -destroyIndexID "manager" | "lookup" | "all" <indexID>
 * 4) ForwardIndexClient [ -cred <credentialFile> ] <scope> -remove "manager" | "lookup" | "all" <colName> <colSchema> <colLang> <indexedFieldNumber> (<keyName>)^<indexedFieldNumber>
 * 5) ForwardIndexClient [ -cred <credentialFile> ] <scope> -feed <colName> <colSchema> <colLang> <rowset_RS_EPR_file> <indexedFieldNumber> (<keyName>)^<indexedFieldNumber> 
 * 6) ForwardIndexClient [ -cred <credentialFile> ] <scope> -lookup <colName> <colSchema> <colLang> <indexedFieldNumber> (<keyName>)^<indexedFieldNumber> "0"|"1"|"2"(stand for the resultType: 0~keys+data|1~onlyKeys|2~onlyData) <keyNameForLookup> [ <operator> <value1> [ <value2> ] ]
 * 7) ForwardIndexClient [ -cred <credentialFile> ] <scope> -multi <colName> <colSchema> <colLang> <indexedFieldNumber> (<keyName>)^<indexedFieldNumber> <multifield-query>
 <multifield-query>: "GET <keyName>('>'|'<'|'>='|'<='|'=')(<value>|'*') [AND <keyName>('>'|'<'|'>='|'<='|'=')(<value>|'*')] [ORDERBY <keyName>] "
 example: "GET title=* AND contributor=* AND date>=01-01-1990 ORDERBY contributor"
 * 8) ForwardIndexClient [ -cred <credentialFile> ] <scope> -list <colName> <colSchema> <colLang> <indexedFieldNumber> (<keyName>)^<indexedFieldNumber>
 
 Example
 
 1) Create a Fwd Index Manager for 
 <scope> = /gcube/devsec 
 <colName> = "EM ESA special issues Living Planet Programme and Earth Observation Handbook" 
 <colSchema> = dc 
 <colLang> = en
 this collection has 4 fields:
 title fwd_string_string 
 subject fwd_string_string 
 creator fwd_string_string 
 contributor fwd_string_string 
 (Requires knowledge of each collection to be tested)  
 In the file examples.txt you can find the keyNames and indexTypeIDs for some collections.
 In any case you can contact the authors of this test suite, to provide you with information about each collection.
 
  
 java IndexManagement.ForwardIndexClient /gcube/devsec -create manager "EM ESA special issues Living Planet Programme and Earth Observation Handbook" dc en 4 title fwd_string_string subject fwd_string_string creator fwd_string_string contributor fwd_string_string
 
 2) Create a Fwd Index Lookup for the aforementioned collection
 
 java IndexManagement.ForwardIndexClient /gcube/devsec -create lookup "EM ESA special issues Living Planet Programme and Earth Observation Handbook" dc en 4 title fwd_string_string subject fwd_string_string creator fwd_string_string contributor fwd_string_string
 (steps 1+2 can be done at once using "-create all")
 
 3) Use the metadata broker in order to build a Result Set that contains the data to be fed to the index. 
 This client outputs the epr of the constructed ResultSet
 
 java IndexManagement.Col_2_fwRowsetRS /gcube/devsec foo "EM ESA special issues Living Planet Programme and Earth Observation Handbook" dc en title_subject_creator_contributor
 
 4) Copy the epr of the Result Set above to a file ./rs.txt and feed the index with the data of this collection. 
 
 java IndexManagement.ForwardIndexClient /gcube/devsec -feed "EM ESA special issues Living Planet Programme and Earth Observation Handbook" dc en ./rs.txt 4 title creator subject contributor
 
 5) Perform a lookup operation (GETALL in reverse order for the keyname title).
 This operation will return the epr that contains the results for this lookup.
 
 java IndexManagement.ForwardIndexClient /gcube/devsec -lookup "EM ESA special issues Living Planet Programme and Earth Observation Handbook" dc en 4 title creator subject contributor 0 title
  
 6) Destroy all the FWD Index resources for this collection in this scope
 
 java IndexManagement.ForwardIndexClient /gcube/devsec -destroy all "EM ESA special issues Living Planet Programme and Earth Observation Handbook" dc en 4 title subject creator contributor
 
  