Indexing and Search Service Output Format and Examples

Skip to end of metadata
Go to start of metadata

Indexing and Search Service Output Format and Examples

This document provides guidance for parsing Indexing and Search Service (ISS) search query results. It also describes how you can specify different result formats in the search query. Several examples of search queries and search query responses are included.

Topics:

Supported Output Formats

You can request a specific output format from a search query by specifying an optional format parameter and content format parameter. The supported format values include RSS, ATOM, or JSON for RSS 2.0, Atom 1.0, or JSON format as described in the OpenSearch 1.1 specification. The supported content format parameters include the standard format (for email, currently), or attachmentOnly, simpleUID, and MJS.

  • When you specify the standard format, the results from the search query contain IMAP URIs that provide a compact representation of the account, folder, and UID of the message with the match.
Note
The IMAP URI should be consumed by an IMAP client to provide access to the data. The URI is not directly usable by a web browser.
  • When you specify attachmentOnly, each result contains URLs to the original attachment and any thumbnails that correspond to it. Also, the totalResults and count-per-page values that are returned refer to the number of attachments that are located, not the number of emails.
  • When you specify simpleUID, the result for each entry contains only the UID number of the matched email. This option applies only when format=ATOM. It is intended to speed up queries to a single folder, such as those queries through IMAP.
  • When you specify MJS (which is only valid when format=JSON), the output is formatted in compact webmail (WMAP) format.

In Indexing and Search Service 1 Update 1, when you specify attachmentOnly, the results contain IMAP URIs that provide the account, folder, UID, and body part number of the attachment with the match.

Sample JSON Output: Standard Format

The following example demonstrates a standard email search that requests three search results out of all the messages in a user's account that match the word "java" in the message body and attachments.

Search query:

http://iss.example.com:8070/rest/search?q=%2busername:jennifer%20%2bhostname:mail.example.com%20%2bbody:java&c=3&format=json

Response:

{
                "title": "iss.example.com:8070 search: +username:jennifer +hostname:mail.example.com +body:java",
                "link": "http://iss.example.com:8070/rest/search?q=+username:jennifer%20+hostname:mail.example.com%20+body:java&c=3&format=json",
        "modified": "Fri May 21 04:40:29 GMT 2010",
        "opensearch:totalResults": "160",
        "opensearch:startIndex": "0",
        "opensearch:itemsPerPage": "3",
        "items": [
        {
                "title": "JSP quick reference guide",
                "link": "imap://jennifer@example.com/convergence;UIDVALIDITY=1246921910/;UID=2",
                "id": "imap://jennifer@example.com/convergence;UIDVALIDITY=1246921910/;UID=2",
                "date": "2008-04-19T03:16:41Z",
                "folder": "convergence",
                "uid": "2",
                "from": "test <test@example.com>",
                "description": "From:test <test@example.com> To:jennifer@example.com Folder:convergence"
        },
        {
                "title": "VTA Bike Map",
                "link": "imap://jennifer@example.com/INBOX;UIDVALIDITY=1195248456/;UID=28",
                "id": "imap://jennifer@example.com/INBOX;UIDVALIDITY=1195248456/;UID=28",
                "date": "2008-04-19T03:12:12Z",
                "folder": "INBOX",
                "uid": "28",
                "from": "test <test@example.com>",
                "description": "From:test <test@example.com> To:jennifer@example.com Folder:INBOX"
        },
        {
                "title": "Installing Sun Java Enterprise System 6",
                "link": "imap://jennifer@example.com/javaone2009;UIDVALIDITY=1243541192/;UID=30",
                "id": "imap://jennifer@example.com/javaone2009;UIDVALIDITY=1243541192/;UID=30",
                "date": "2009-05-28T20:47:16Z",
                "folder": "javaone2009",
                "uid": "30",
                "from": "Jennifer <jennifer@example.com>",
                "description": "From:Jennifer <jennifer@example.com> To:jennifer@example.com Folder:javaone2009"
        }
        ]
}

Sample JSON Output: attachmentOnly Format

The following example demonstrates a sample attachmentOnly search that requests three search results from all attachments in a user's account.

Search query:

http://iss.example.com:8070/rest/search?q=%2busername:jennifer%20%2bhostname:mail.example.com%20%2battachment-type:%28atdoc%20atppt%20atxls%20atvcf%20atvsd%20ataudio%20atcompress%20athtml%20atimage%20atiwork%20atjpeg%20atodf%20atpdf%20atplain%20atrtf%20atsencr%20atssign%20atvideo%20atxml%29&contentFormat=attachmentOnly&thumbnail=s&c=3&format=json

Response:

{
                "title": "iss.example.com:8070 search: +username:jennifer +hostname:mail.example.com +attachment-type:(atdoc atppt atxls atvcf atvsd ataudio atcompress athtml atimage atiwork atjpeg atodf atpdf atplain atrtf atsencr atssign atvideo atxml)",
                "link": "http://iss.example.com:8070/rest/search?q=+username:jennifer%20+hostname:mail.example.com%20+attachment-type:(atdoc%20atppt%20atxls%20atvcf%20atvsd%20ataudio%20atcompress%20athtml%20atimage%20atiwork%20atjpeg%20atodf%20atpdf%20atplain%20atrtf%20atsencr%20atssign%20atvideo%20atxml)&amp;c=3&amp;format=json",
        "modified": "Fri May 21 04:26:50 GMT 2010",
        "opensearch:totalResults": "1511",
        "opensearch:startIndex": "0",
        "opensearch:itemsPerPage": "3",
        "items": [
        {
                "title": "100_0059.JPG",
                "link": "imap://jennifer@mail.example.com/Sent;UIDVALIDITY=1272042833/;UID=1/;section=2",
                "id": "imap://jennifer@mail.example.com/Sent;UIDVALIDITY=1272042833/;UID=1/;section=2",
                "type": "atjpeg",
                "content-type": "image/jpeg",
                "size": "3563598",
                "date": "2010-01-11T14:36:13Z",
                "folder": "Sent",
                "uid": "1",
                "part": "2",
                "from": "user71 71 <user71@example.com>",
                "subject": "email with attachment",
                "media": {"m": "http://iss.example.com:8070/store/data/01/26/h1/u26/f3/1272042833/00/1/tbn_medium_1_.jpg?fqdn=iss.example.com&mailhost=mail.example.com"},
                "description": "Subject: email with attachment Folder: Sent Size: 3563598 bytes<p><a href=\"http://iss.example.com:8070/store/data/01/26/h1/u26/f3/1272042833/00/1/pic_1_.jpg?fqdn=iss.example.com&mailhost=mail.example.com&filename=100_0059.JPG\"><img src=\"http://iss.example.com:8070/store/data/01/26/h1/u26/f3/1272042833/00/1/tbn_small_1_.jpg?fqdn=iss.example.com&mailhost=mail.example.com\" height=\"75\" width=\"75\" alt=\"100_0059.JPG\"></a>"
        },
        {
                "title": "72285838.mov",
                "link": "imap://jennifer@mail.example.com/MIME tests;UIDVALIDITY=1266451357/;UID=1/;section=2",
                "id": "imap://jennifer@mail.example.com/MIME tests;UIDVALIDITY=1266451357/;UID=1/;section=2",
                "type": "atvideo",
                "content-type": "video/quicktime",
                "size": "13892792",
                "date": "2010-02-17T23:52:51Z",
                "folder": "MIME tests",
                "uid": "1",
                "part": "2",
                "from": "Jennifer <jennifer@example.com>",
                "subject": "72285838.mov",
                "media": {"m": "http://iss.example.com:8070/store/data/icons/video.png?fqdn=iss.example.com&mailhost=mail.example.com"},
                "description": "Subject: 72285838.mov Folder: MIME tests Size: 13892792 bytes<p><a href=\"http://iss.example.com:8070/store/data/01/26/h1/u26/f7/1266451357/00/1/video_1_?fqdn=iss.example.com&mailhost=mail.example.com&filename=72285838.mov\"><img src=\"http://iss.example.com:8070/store/data/icons/video.png?fqdn=iss.example.com&mailhost=mail.example.com\"  alt=\"72285838.mov\"></a>"
        },
        {
                "title": "osol_poster.odg",
                "link": "imap://jennifer@mail.example.com/INBOX;UIDVALIDITY=1195248456/;UID=33/;section=2",
                "id": "imap://jennifer@mail.example.com/INBOX;UIDVALIDITY=1195248456/;UID=33/;section=2",
                "type": "atodf",
                "content-type": "application/vnd.oasis.opendocument.graphics",
                "size": "665190",
                "date": "2008-04-19T03:27:13Z",
                "folder": "INBOX",
                "uid": "33",
                "part": "2",
                "from": "test <test@example.com>",
                "subject": "OpenSolaris poster",
                "media": {"m": "http://iss.example.com:8070/store/data/01/26/h1/u26/f1/1195248456/00/33/tbn_medium_1_.png?fqdn=iss.example.com&mailhost=mail.example.com"},
                "description": "Subject: OpenSolaris poster Folder: INBOX Size: 665190 bytes<p><a href=\"http://iss.example.com:8070/store/data/01/26/h1/u26/f1/1195248456/00/33/odf_1_?fqdn=iss.example.com&mailhost=mail.example.com&filename=osol_poster.odg\"><img src=\"http://iss.example.com:8070/store/data/01/26/h1/u26/f1/1195248456/00/33/tbn_small_1_.png?fqdn=iss.example.com&mailhost=mail.example.com\"  alt=\"osol_poster.odg\"></a>"
        }
        ]
}

Labels:
indexsearchservice indexsearchservice Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.