Tuesday, June 17, 2014

Indexing and Searching using IDOL OnDemand

IDOL OnDemand API Tutorial
IDOL OnDemand delivers a rich set of web service APIs to enable developers to create ground-breaking data driven apps.To get more details on each HP IDOL OnDemand API click here
In this tutorial we are going to cover only 5 APIs,
  • Create Index
  • Obejct Store
  • View Document
  • Find Related Concepts
  • Find Similar
For all APIs, calls are made using JQuery
$('div.api').bind('click', function() {
    $.ajax({url:URL,
 success:function(result){    
 //convert into JSON
 var third4 = JSON.stringify(result,undefined,2)     
 //process the data 
  },error:function(data){
//Handling Error 
  }
  }); 
});


Create Index : The Create Text Index API allows you to create a text index, that you can use to add your own content to IDOL OnDemand. Here we are creating index called 'Cancer Prevention'
URL = https://api.idolondemand.com/1/api/sync/createtextindex
/v1?index=Cancer+Prevention&flavor=explorer&
apikey=dac630d2-4aed-45b7-8fc7-99fa87858460


Store Object : The Store Object API takes a file, reference, or an input URL and stores the contents of the document for use in other APIs. It returns the object store reference, which you can pass to other APIs to process the document that you store. In this tutorial API takes Files from url -> http://www.cancer.org/acs/groups/cid/documents/webcontent/002577-pdf.pdf
URL = https://api.idolondemand.com/1/api/sync/storeobject
/v1?url=http%3A%2F%2Fwww.cancer.org%2Facs%2Fgroups%2Fcid%2F
documents%2Fwebcontent%2F002577-pdf.pdf&
apikey=dac630d2-4aed-45b7-8fc7-99fa87858460


view document call: Converts a document to HTML format for viewing in a Web browser. in this snippet we are executing a view document call and and highlighting the phrase 'physical activity' in the document.
URL = https://api.idolondemand.com/1/api/sync/viewdocument/
v1?url=http%3A%2F%2Fwww.cancer.org%2Facs%2Fgroups%2Fcid%2F
documents%2Fwebcontent%2F002577-pdf.pdf&highlight_expression
=physical+activity&start_tag=%3Cb%3E&raw_html=true&
apikey=dac630d2-4aed-45b7-8fc7-99fa87858460


Find Related Concepts Returns the best terms and phrases in documents that match the specified query.
URL = https://api.idolondemand.com/1/api/sync/findrelatedconcepts/
v1?reference=b856d643-bc0a-48f6-88a2-e7489aa33be9&
sample_size=5&apikey=dac630d2-4aed-45b7-8fc7-99fa87858460


Find Similar API : Finds documents that are conceptually similar to your text or a document. Returns documents in the IDOL OnDemand databases that are similar to text or a document that we provide. We can either submit text, an index reference, a file, an Store Objetc reference, or a URL.
 URL = https://api.idolondemand.com/1/api/sync/findsimilar
/v1?text=Hello+World&indexes=wiki_eng&apikey=
dac630d2-4aed-45b7-8fc7-99fa87858460

Related posts

Few more API calls using JQuery

IDOL OnDemand API Call using Java

No comments: