THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- 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:
http://localhost:8080/solr/select/?q=:
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 |
http://localhost:8080/solr/select/?q=CAS.ProductName:test.txto
- 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 |