Get Chunks
This API is used to retrieve all the chunks from the SearchAssist application corresponding to the input parameters.
Method | POST |
Endpoint | <host_url>/searchassistapi/external/stream/<streamId>/chunks |
Request Headers | Content-Type: application/json
Auth: <JWT Token> |
Content-Type | application/json |
Authorization | auth: <JWT Token> |
API Scope | Chunks |
Query Parameters:
streamID: Provide your application ID here.
indexPipelineId: Provide the IndexConfiguration Id here.
enableFilters: This is a boolean field that enables or disables the filters. When set to false, the filters in the request body are ignored.
Request Parameters:
Parameters | Description | Mandatory |
Skip | Number of records to be skipped from the beginning. This is useful when there are a lot of records matching the query and you need to fetch responses in parts. | No. When not provided, the default value of 0 is used. |
Limit | This is the number of records to be fetched as a response to the API call, starting with a record after the skip count. | No. When not provided, the default value of 50 is used. |
docId | Unique Document ID corresponding to which the chunks are to be retrieved. | No |
pageNumber | Page number of the document corresponding to which the chunks are to be retrieved. This is used along with docId to get chunks from a specific page of a document. | No |
filters | Conditions to filter out a set of chunks. This field takes two parameters: – operand – logical operator to be used between the conditions specified. – conditions – conditions to filter out chunks. For example, to fetch chunks for all the content from Google Drive Cloud Storage, add filter as shown below. “filters”: { “operand”: “OR”, “conditions”: [ { “key”: “sourceName”, “op”: “equals”, “value”: “Gdrive content” }, { “key”: “sourceType”, “op”: “equals”, “value”: “googleDrive” }] } You can add filters corresponding to all the chunk fields available in the Chunk Browser. Refer to this for more details. |
No |
Sample Request
{ "search": "mutual funds", "skip": 0, "limit": 10, "docId": "d-23450-354432-45432340-345", "pageNumber": 2, "filters": { "operand": "AND", "conditions": [] } }
Get Chunk By ID
This API is used to retrieve a specific chunk from the SearchAssist application.
Method | GET |
Endpoint | <host_url>/searchassistapi/external/stream/<streamId>/chunks/{chunkId} |
Request Headers | Content-Type: application/json
Auth: <JWT Token> |
Content-Type | application/json |
Authorization | auth: <JWT Token> |
API Scope | Chunks |
Query Parameters:
streamId: Provide your application ID here.
chunkId: Provide the chunk ID here.
Sample Response
{ "data": [ { "sourceId": "fs-ce0dc13c-f764-4656-a324-ab1f8f27e6fe", "recordTitle": "Reasons to choose kore.ai SearchAssist.pdf", "pageNumber": 2, "docId": "fc-c9b75cc4-a664-571b-b757-8091575f1004", "recordUrl": "https://searchassist-qa.kore.ai:443/searchassistapi/getMediaStream/findly/f-d288841b-c3a8-5433-acbb-d2243c1c9dc8.pdf?n=2161151100&s=IjlzR1NCdk53T3hiOVJFelQvTVpIek1xamFacHVtMGx3SVNwbkpNTmlobHc9Ig$$#page=2", "searchIndexId": "sidx-ba5fe733-341e-5233-8ab2-eac7ec881ea3", "sourceAcl": [ "*" ], "chunkType": "Text", "chunkId": "chk-396cd9af-d4c7-40cc-8ed8-f3211861d268", "createdOn": "2024-05-05T11:58:20.246828988Z", "chunkContent": "recordTitle : Reasons to choose kore.ai SearchAssist.pdf; chunkText : Knowledge, document/file and content databases as well as geospatial data Federated search (SharePoint, Box, Google Drive, content management systems) Instant messages and multimedia content (metadata search) Kore.ai is a global leader in the conversational AI platform and solutions helping enterprises automate front and back office business interactions to deliver extraordinary experiences for their customers, agents, and employees. More than 350 Fortune 2000 companies trust Kore.ai Experience Optimization (XO) Platform and technology to automate their business interactions for millions of users worldwide to achieve extraordinary business outcomes.; ", "chunkText": " Knowledge, document/file and content databases as well as geospatial data Federated search (SharePoint, Box, Google Drive, content management systems) Kore.ai is a global leader in the conversational AI platform and solutions helping enterprises automate front and back office business interactions to deliver extraordinary experiences for their customers, agents, and employees. More than 350 Fortune 2000 companies trust Kore.ai Experience Optimization (XO) Platform and technology to automate their business interactions for millions of users worldwide to achieve extraordinary business outcomes.", "sourceUrl": "https://searchassist-qa.kore.ai:443/searchassistapi/getMediaStream/findly/f-d288841b-c3a8-5433-acbb-d2243c1c9dc8.pdf?n=2161151100&s=IjlzR1NCdk53T3hiOVJFelQvTVpIek1xamFacHVtMGx3SVNwbkpNTmlobHc9Ig$$", "sourceType": "file", "chunkMeta": {}, "chunkTitle": "", "extractionMethod": "text", "sourceName": "Default", "extractionStrategy": "" } ] }
Update Chunk By Id
This API is used to update a specific chunk in the SearchAssist application.
Method | PUT |
Endpoint | <host_url>/searchassistapi/external/stream/<streamId>/chunks/{chunkId} |
Request Headers | Content-Type: application/json
Auth: <JWT Token> |
Content-Type | application/json |
Authorization | auth: <JWT Token> |
API Scope | Chunks |
Query Parameters:
streamId: Provide your application ID here.
chunkId: Provide the chunk ID for the chunk to be updated.
indexPipelineId: Index configuration ID
Request Parameters:
You can update all the fields of a chunk except the following fields: ‘chunkId’, ‘searchIndexId’, ‘docId’, ‘indexPipelineId’, ‘sourceId’, ‘createdOn’, ‘modifiedOn’.
Sample Request
{ "chunkContent": "recordTitle : India Holiday List 2023.pdf; chunkText : cjhdvbejshvjnjkijk bhjn;", "chunkId": "chk-9876-9876-8760-8765", "chunkText": "3/31/22, 8:42 AM Nonprofits and Cryptocurrency | PNC Insights https://www.pnc.com/insights/corporate-institutional/manage-nonprofit-enterprises/nonprofits-and-cryptocurrency.html?lnksrc=pnc-insights-feed 5/5 investment management activities conducted by PNC Capital Advisors, LLC, an SEC-registered investment adviser and wholly-owned subsidiary of PNC Bank. PNC does not provide legal, tax, or accounting advice unless, with respect to tax advice, PNC Bank has entered into a written tax services agreement. PNC Bank is not registered as a municipal advisor under the Dodd-Frank Wall Street Reform and Consumer Protection Act. "PNC Institutional Asset Management" is a registered mark of The PNC Financial Services Group, Inc. Investments: Not FDIC Insured. No Bank Guarantee. May Lose Value.", "chunkTitle": "chk-9876-9876-8760-8765", "chunkType": "Text", "createdOn": "2024-02-20T05:37:34.697576166Z", "docId": "fc-fc891fac-c2b7-521f-aff9-26b17b202ceb", "extractionMethod": "text", "modifiedOn": "2024-02-21T05:37:34.697576166Z", "pageNumber": 2, "recordTitle": "India Holiday List 2023.pdf", "recordUrl": "https://searchassist-dev.kore.ai:443/searchassistapi/getMediaStream/findly/f-0f5f2127-59f2-56a7-884a-322980e33e68.pdf?n=518947827&s=IkZzZE16YW5pVkFmaHpaUTB3YkFENytPQUwyWXVxdm02Y0dZRmJPSnBOeUk9Ig$#page=1", "searchIndexId": "sidx-4a3aacb7-1c70-54eb-a7f6-e90a1ccbb75f", "sourceId": "fs-f482cfc3-1b6e-5a44-b987-5330977d3aaf", "sourceName": "Default", "sourceType": "https://searchassist-dev.kore.ai:443/searchassistapi/getMediaStream/findly/f-0f5f2127-59f2-56a7-884a-322980e33e68.pdf?n=518947827&s=IkZzZE16YW5pVkFmaHpaUTB3YkFENytPQUwyWXVxdm02Y0dZRmJPSnBOeUk9Ig$", "chunkMeta": {}, "_id": "VE8FxY0BFgynVx3EExRF" }
Adding a new field while updating a Chunk
While updating a chunk, if a new field is added, it is added as a field in the existing chunkMeta field. For example, assume the sample request is as shown below where along with updating the recordTitle for a chunk, a new field is added for the editor information.
{ "recordTitle": "Reasons to choose kore.ai SearchAssist.pdf", "Editor": "user@company.com" } |
In the above case, the new field added above would be stored in the corresponding chunk as shown below.
"chunkMeta": { "Editor": "user@company.com" }, |