The content API is used to access specific documents when their identifiers are known.
The content API is implemented under the /content URI namespace. It is an entity-based API.
Care must be taken to properly encode DocId arguments. A DocId is composed of colon-separated tokens, so if a DocId is URL-encoded for inclusion in the URL path, colons within each of the tokens must be double-encoded so that when they are URL-decoded on the server side, the embedded colons are still (singly) URL-encoded. If this is not done, two problems may occur : a 404 Not Found error, or an error response stating that the requested document is not found.
Contents
Content Summary
Fetches the DocSummary for one or more DocId.
URL
/content/[docId]
Examples
- Fetch the DocSummary for a document
Content Fields
Returns complete document TextFields for a DocId.
URL
/content/[docId]/fields
Examples
- Fetch the TextFields for a document.
Render Content
Renders the title and content or summary for one or more DocId. The purpose of this method is to highlight specific words in the document. The words that should be highlighted are specified by passing in one or more TextFields. The rendering process is intelligent, in that the Recognizer is applied to each TextField and the rendering is based on the recognized topics.
URL
/content/[docId]/render
Parameters
- field[]
one or more TextFields to recognize.
- openDelim
character string to insert before each rendered word. Default is <strong>
- closeDelim
character string to append after each rendered word. Default is </strong>
- renderAll
if no fields are specified, this parameter may be true to render all recognized topics.
- htmlEncode
whether to encode the text so that it can be displayed as valid HTML. This option is true by default, and it should be enabled if the openDelim and closeDelim are HTML tags.
- tokenFilter
whether to use the !MySQL or Lucene stop word list to avoid highlighting stop words. The default is Lucene.
Examples
- Render all recognized topics in a document
- Render all recognized topics as plain text
content/s3:PubMed:11108510/render?renderAll=true&openDelim=*&closeDelim=*&htmlEncode=false
- Render recognized words and concepts
content/s3:PubMed:11108510/render?fields[0].text=diabetes+and+dna
