Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This document is intended as a guide to quickly deploy and test a system composed of the OODT File Manager and Solr. For a more in-depth discussion of the Solr File manager architecture and customization, see the complete Solr File Manager guideManager Developer's Guide.

We assume thet the system is deployed on a Unix platform (including Mac-OSX), and that the user has basic familiarity with the Unix operating system. The installation can take place in any directory on the system to where the user has access, for example under '/usr/local/oodt'. To install under any other directory, simply replace '/usr/local/oodt' with your custom path in the instructions below.

...

  • Download and install a Solr version of 4.X or above (Please note that Solr 4.3 and higher may require logging configuration):
Code Block
cp solr-4.2.0.tar /usr/local/oodt/.
cd /usr/local/oodt
tar xvf solr-4.2.0.tar
ln -s ./solr-4.2.0 ./solr
  • Install the Solr war file into the Tomcat directory (note that the Solr distribution must be renamed to solr.war as in the example command abovebelow):
Code Block
cp /usr/local/oodt/solr/dist/solr-4.2.0.war /usr/local/oodt/apache-tomcat/webapps/solr.war

...

  • In a browser, issue a query to Solr for all records in the index: http://localhost:8080/solr/select?q=*:* A single document should be returned, containing all the available metadata for the product just archived. Note how the metadata fields include the product id, the core CAS fields (starting with 'CAS....'), and additional fields parsed from the metadata file such as 'topic'. The response XML after ingesting one such document is reported below as an example:
Code Block
<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">1</int>
    <lst name="params">
      <str name="q">*:*</str>
    </lst><lst>
  </lst>
  <result name="response" numFound="1" start="0">
<doc><str
    <doc>
      <str name="id">28565cc2-237d-4de6-a455-434f55fa7b53</str>
      <str name="CAS.ProductId">28565cc2-237d-4de6-a455-434f55fa7b53</str>
      <str name="CAS.ProductTypeName">GenericFile</str>
      <date name="CAS.ProductReceivedTime">2013-04-26T10:59:16Z</date>
      <str name="CAS.ProductTransferStatus">RECEIVED</str>
      <str name="CAS.ProductName">test.txt</str>
      <str name="CAS.ProductTypeId">urn:oodt:GenericFile</str>
      <str name="CAS.ProductStructure">Flat</str>
      <arr name="topic"><str>computer science</str></arr>
      <arr name="FileLocation"><str>/usr/local/oodt/archive/test.txt</str></str>
</arr><arrarr>
      <arr name="MimeType"><str>text/plain</str><str>text</str>
      <str>plain</str></arr><arr name="Filename"><str>test.txt</str></arr>
      <arr name="CAS.ReferenceFileSize"><long>10</long></arr>
      <arr name="CAS.ReferenceMimeType"><str>text/plain</str></arr>
      <arr name="CAS.ReferenceDatastore"><str>file:/usr/local/oodt/archive/test.txt/test.txt</str></arr>
      <arr name="CAS.ReferenceOriginal"><str>file:///tmp/test.txt</str></arr>
      <long name="_version_">1433398733668614144</long>
    </doc>
  </result>
</response>

...

Step 5: Additional client commands examples

...

  • Querying the CAS catalog direcly through Solr with a browser:
Code Block

http://localhost:8080/solr/select/?q=*:*

...



http://localhost:8080/solr/select/?q=science

...



http://localhost:8080/solr/select/?q=CAS.ProductTypeName:GenericFile

...



http://localhost:8080/solr/select/?q=CAS.ProductName:test.txt

...

  • Using the OODT query tool:
Code Block

cd /usr/local/oodt/cas-filemgr/bin

...



./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductStructure:Flat'

...



./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductTypeName:GenericFile'

...



./query_tool --url http://localhost:9000 --sql -query 'SELECT * FROM GenericFile'

...



./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductStructure:Flat AND CAS.ProductTransferStatus:RECEIVED'

...



./query_tool --url http://localhost:9000 --lucene -query 'CAS.ProductName:test.txt'

...

  • Using the cas-filemgr-client:
Code Block

cd /usr/local/oodt/cas-filemgr/bin

...



./filemgr-client --url http://localhost:9000 --operation --ingestProduct --productName test.txt --productStructure Flat --productTypeName GenericFile --metadataFile file:///tmp/test.txt.met --refs file:///tmp/test.txt

...



./filemgr-client -op --deleteProductByName --productName test.txt --url http://localhost:9000

...



./filemgr-client -op --deleteProductById --productId 14324704-2afe-4267-acad-503baf3af1d4 --url http://localhost:9000

...



./filemgr-client -op --hasProduct --productName test.txt --url http://localhost:9000

...



./filemgr-client -op --getProductTypeByName --productTypeName GenericFile --url http://localhost:9000

...



./filemgr-client -op --getNumProducts --productTypeName GenericFile --url http://localhost:9000

...



./filemgr-client -op --getProductByName --productName test.txt --url http://localhost:9000

...



./filemgr-client -op --getProductById --productId d749a67d-d012-4f55-b5ec-b53b6a91c676 --url http://localhost:9000

...



./filemgr-client -op --dumpMetadata --productId d749a67d-d012-4f55-b5ec-b53b6a91c676 --url http://localhost:9000

...



./filemgr-client -op --getFirstPage --productTypeName GenericFile --url http://localhost:9000

...



./filemgr-client -op --getNextPage --curPage 1 --productTypeName GenericFile --url http://localhost:9000

...



./filemgr-client -op --getPrevPage --curPage 2 --productTypeName GenericFile --url http://localhost:9000

...



./filemgr-client -op --getLastPage --productTypeName GenericFile --url http://localhost:9000