GETTING STARTED
SearchAssist Overview
SearchAssist Introduction
Onboarding SearchAssist
Build your first App
Glossary
Release Notes
What's new in SearchAssist
Previous Versions

CONCEPTS
Managing Sources
Introduction
Files
Web Pages
FAQs
Structured Data 
Connectors
Introduction to Connectors
Azure Storage Connector
Confluence Cloud Connector
Confluence Server Connector
Custom Connector
DotCMS Connector
Dropbox Connector
Google Drive Connector
Oracle Knowledge Connector
Salesforce Connector
ServiceNow Connector
SharePoint Connector
Zendesk Connector
RACL
Virtual Assistants
Managing Indices
Introduction
Index Fields
Traits
Workbench
Introduction to Workbench
Field Mapping
Entity Extraction
Traits Extraction
Keyword Extraction
Exclude Document
Semantic Meaning
Snippet Extraction
Custom LLM Prompts
Index Settings
Index Languages
Managing Chunks
Chunk Browser
Managing Relevance
Introduction
Weights
Highlighting
Presentable
Synonyms
Stop Words
Search Relevance
Spell Correction
Prefix Search
Custom Configurations
Personalizing Results
Introduction
Answer Snippets
Introduction
Extractive Model
Generative Model
Enabling Both Models
Simulation and Testing
Debugging
Best Practices and Points to Remember
Troubleshooting Answers
Answer Snippets Support Across Content Sources
Result Ranking
Facets
Business Rules
Introduction
Contextual Rules
NLP Rules
Engagement
Small Talk
Bot Actions
Designing Search Experience
Introduction
Search Interface
Result Templates
Testing
Preview and Test
Debug Tool
Running Experiments
Introduction
Experiments
Analyzing Search Performance
Overview
Dashboard
User Engagement
Search Insights
Result Insights
Answer Insights

ADMINISTRATION
General Settings
Credentials
Channels
Team
Collaboration
Integrations
OpenAI Integration
Azure OpenAI Integration
Custom Integration
Billing and Usage
Plan Details
Usage Logs
Order and Invoices
Smart Hibernation

SearchAssist APIs
API Introduction
API List

SearchAssist SDK

HOW TOs
Use Custom Fields to Filter Search Results and Answers
Add Custom Metadata to Ingested Content
Write Painless Scripts
Configure Business Rules for Generative Answers

API List

Full Search API

This API is used to fetch search results and answers generated corresponding to the input query. This API returns results from all the data ingested into the SearchAssist application.  

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fullsearch
Content Type application/json
Authorization auth: <JWT Token>
API Scope       Full Search

Query Parameters:

 streamID: Provide your application ID here. 

 Request Parameters:

 

Parameters Description Mandatory
query Query string for search Yes
maxNumOfResults Maximum number of results to be returned in the response. Yes
lang The language used for the query. No. By default, this is set to English.
customData Custom data to be sent in the request. This data can be used to further process or filter the search results in the application.  For example, you can use this field to set user context like user identity, location, etc. No
SearchSettings Search settings to be applied to the fields. Default search configuration of the application is overridden when searchsettings are provided. No
includeChunksInResponse This can be set to true or false. When set to true and if answers snippets are enabled, the response will also have the list of qualified chunks along with other parameters. The chunk information is stored in chunk_result

Field in the response.

No
IncludeMetaDataAnswers This field can fetch specific chunk metadata fields in the Answer along with the default fields. The requested fields are returned as part of the graph_answer field in the response. For instance, to fetch the author name(a metadata field) and subtitle(a custom field) additionally from the chunks, include the following in the request payload. “IncludeMetaDataAnswers”: [“chunkMeta.author”, “subtitle”].

Note:
1. For metadata fields, use the field name along with the root name, such as chunkMeta.<x>, as shown in the above example.
2. If a metadata field listed in this object does not exist, the field is returned with a null value.
No
IncludeMetaDataSearchResults This parameter accepts an array that lists the specific fields to be included in the response, along with the default fields. The fields are returned in the results field in the response.

For example : to fetch the title and url from the meta fields, set the field as shown below. 

“IncludeMetaDataSearchResults”: [“meta_data.title”, “meta_data.url”]

No

Sample Request 

{
  "query": "national pension scheme",
  "maxNumOfResults": 2
}

Sample Response 

{
    "templateType": "search",
    "requestId": "fsh-cf761dfc-f838-5004-a0ff-9dc8e2782427",
    "template": {
        "originalQuery": "national pension scheme",
        "spellCorrectedQuery": "national pension scheme",
        "results": {
            "web": {
                "data": [
                    {
                        "contentId": "fc-e0b42267-0c7f-4aab-a539-6ebfedff9bd6",
                        "sys_content_type": "web",
                        "score": 125.62481,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://searchassist-qa.kore.ai/searchassistapi/redirect?rurl=https%3A%2F%2Fwww.paytmmoney.com%2Fnps-national-pension-scheme&requestId=fsh-cf761dfc-f838-5004-a0ff-9dc8e2782427&contentId=fc-e0b42267-0c7f-4aab-a539-6ebfedff9bd6&hId=87b209cfa9a2b8720df2138a116915ea540f42e637bf95abf1122b55cc52e032",
                        "sys_source_name": "paytm money",
                        "page_title": "National Pension Scheme - NPS Scheme, Online Account Opening & Contibution",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:36.042000",
                        "page_preview": "NPS / National Pension Scheme is a smart way to accumulate a retirement corpus for yourself in an effective manner. Know about NPS scheme features, benefits & contribution under Section 80C."
                    },
                    {
                        "contentId": "fc-374d9c6c-1afe-4d19-8078-7f4dd12f05f6",
                        "sys_content_type": "web",
                        "score": 14.741463,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://searchassist-qa.kore.ai/searchassistapi/redirect?rurl=https%3A%2F%2Fwww.paytmmoney.com%2F&requestId=fsh-cf761dfc-f838-5004-a0ff-9dc8e2782427&contentId=fc-374d9c6c-1afe-4d19-8078-7f4dd12f05f6&hId=c8b24d6dfbdc8d8ae08167366feb09719cc9b5fe75e0531d7646e557d80fd098",
                        "sys_source_name": "paytm money",
                        "page_title": "Paytm Money - Online Demat Account, Trading, Direct Mutual Funds & NPS",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:33.981000",
                        "page_preview": "Open online demat account & start your stocks trading journey. Invest in best direct mutual funds with zero commission. Save taxes & enjoy regular pension income with NPS only on Paytm Money."
                    }
                ],
                "doc_count": 7
            }
        },
        "facets": [],
        "tabFacet": {
            "fieldName": "sys_content_type",
            "buckets": [
                {
                    "key": "web",
                    "doc_count": 7,
                    "name": "Web Results"
                }
            ]
        },
        "resultType": "grouped",
        "graph_answer": {
            "payload": []
        },
        "query_language": "en"
    },
    "relay": "default",
    "queryPipelineId": "fqp-b2dec185-2162-509d-a07e-49657625b155",
    "indexPipelineId": "fip-8a1ffeb2-1b9d-5b4e-b2a9-e415ad5968a8"
}

Live Search API

This API dynamically fetches search results from the SearchAssist application based on the input query. The API returns relevant results from all the data ingested into the application. 

Note: The API does not return answers as part of the response.
Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/livesearch
Content Type application/json
Authorization auth: <JWT Token>
API Scope       Live Search

Query Parameters:

streamId: Provide your application ID here. 

Request Parameters:

Parameters Description Mandatory
query Query string for search Yes
maxNumOfResults Maximum number of results to be returned in the response. Yes
lang The language used for the query. No. By default, this is set to English.
customData Custom data to be sent in the request. This data can be used to further process or filter the search results in the application.  For example, you can use this field to set user context like user identity, location, etc. No
SearchSettings This field allows you to set the search settings to be applied before returning the search results. These fields override the default search configuration of the SearchAssist application. Refer to the request payload shown below to learn about the usage. No

Sample Request:

{
  "query": "national pension scheme",
  "maxNumOfResults": 2
}

Sample Response:

{
    "templateType": "liveSearch",
    "requestId": "fsh-b746d2fb-51ff-5108-b8bd-f34275215fbe",
    "template": {
        "originalQuery": "national pension scheme",
        "spellCorrectedQuery": "national pension scheme",
        "results": {
            "web": {
                "data": [
                    {
                        "contentId": "fc-e0b42267-0c7f-4aab-a539-6ebfedff9bd6",
                        "sys_content_type": "web",
                        "score": 125.62481,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://www.paytmmoney.com/nps-national-pension-scheme",
                        "sys_source_name": "paytm money",
                        "page_title": "National Pension Scheme - NPS Scheme, Online Account Opening & Contibution",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:36.042000",
                        "page_preview": "NPS / National Pension Scheme is a smart way to accumulate a retirement corpus for yourself in an effective manner. Know about NPS scheme features, benefits & contribution under Section 80C."
                    },
                    {
                        "contentId": "fc-374d9c6c-1afe-4d19-8078-7f4dd12f05f6",
                        "sys_content_type": "web",
                        "score": 14.741463,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://www.paytmmoney.com/",
                        "sys_source_name": "paytm money",
                        "page_title": "Paytm Money - Online Demat Account, Trading, Direct Mutual Funds & NPS",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:33.981000",
                        "page_preview": "Open online demat account & start your stocks trading journey. Invest in best direct mutual funds with zero commission. Save taxes & enjoy regular pension income with NPS only on Paytm Money."
                    }
                ],
                "doc_count": 7
            }
        },
        "facets": [],
        "tabFacet": {
            "fieldName": "sys_content_type",
            "buckets": [
                {
                    "key": "web",
                    "doc_count": 7,
                    "name": "Web Results"
                }
            ]
        },
        "resultType": "grouped",
        "graph_answer": {
            "payload": {}
        },
        "query_language": "en"
    },
    "relay": "default",
    "queryPipelineId": "fqp-b2dec185-2162-509d-a07e-49657625b155",
    "indexPipelineId": "fip-8a1ffeb2-1b9d-5b4e-b2a9-e415ad5968a8"
}

 

Auto Suggestions API

Returns predictions related to the query data in response to an HTTP request. It can be used to provide autocomplete functionality for text-based search functionality. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<enter-your-AppId-here>/autosuggestion
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Auto Suggestions

Request Parameters:

Parameters Description Mandatory
query Query string for search Yes
maxNumOfResults Maximum number of results to be returned in the response. Yes
lang The language used for the query. No. By default, this is set to English.

Sample Request:

{
"query": "mutual funds",
"maxNumOfResults": 4,
"lang": "en" 
}

Sample Response:

{
    "requestId": "sr-a2c28109-83c8-49a3-8eee-e6c893f0e8ba",
    "originalQuery": "mutual funds",
    "autoComplete": {
        "querySuggestions": [
            "Paytm Money - Online Demat Account, Trading, Direct Mutual Funds & NPS",
            "Invest In Best Direct Mutual Funds In India | Paytm Money",
            "Advantages of Mutual Funds - Benefits of Investing in Mutual Funds",
            "Zero Pricing | Unlimited Buying & Selling of Mutual Funds for Free - Paytm Money"
        ],
        "typeAheads": [
            "funds &"
        ]
    }
}

Ingest Data API

This API is used to ingest data into the SearchAssist application. Currently, the feature is limited to ingesting structured data or files. Note that answers will be generated from this structured data only if the ingested content has ‘title’ and ‘content’ as keys in the object.  

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<enter-your-AppId-here>/ingest?contentSource=<content-source-value>&extractionType=<extraction-type-value>&index=<index-value>
Content Type application/json
Authorization auth: <JWT Token>
API Scope Ingest Data

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here. Yes
contentSource Source of the data. Set this to ‘manual’. Yes
extractionType Type of data expected in the requested body. For structured data, set this field to ‘data’, for ingesting files, set this to ‘file’. Yes
index This parameter tells the application to train the application for the ingested data. If this field is set to true, the SearchAssist application is trained with the ingested data immediately.  Note that the training is done using the default Index and Search Configurations set at the time of invoking the API.  When set to false, you have to run the training operation separately. Yes

Request Parameters

Parameters Description Mandatory
name Name given to the ingested data. This is used internally by the searchassist application.  Yes
documents Array of objects containing structured data or files. 

For Structured Data:

If there is a ‘doc_id’ field in the object, it is used as an identifier for the object in SearchAssist. If this field is not provided in the object, it is auto-generated by SearchAssist when this object is ingested.

For Files:

Provide the ‘fileId’ for the uploaded file that needs to be ingested into the application.   This fileId is generated when the file is uploaded to the SearchAssist application server. Check uploadfile API below for more details.

Yes 

Sample Request(Structured Data):

{
  "name": "Some Group Name",
  "documents": [{
      "id": "1",
      "jobTitle": "Service Supervisor1",
      "emailAddress": "Gemma_Allen8451@sveldo.biz",
      "firstNameLastName": "Gemma Allen"
  },
  {
      "id": "2",
      "jobTitle": "Service Supervisor2",
      "emailAddress": "Liv_Baker8412@jiman.org",
      "firstNameLastName": "Liv Baker"
  }]
}

Sample Response(Structured Data):

[
    {
        "_id": "fc-dd2ba8bb-2c01-5ff4-bc89-2e3e31b2ff20",
        "searchIndexId": "sidx-faf6e26a-e2f5-5493-9f62-778a059815f4",
        "streamId": "st-3b258741-511d-564e-a4c8-b69a2d62d5ea",
        "dataSourceGroupId": "dsg-87aeed73-d39e-57b7-ad28-a5eb7e6aed0a",
        "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "createdOn": "2023-03-13T06:01:49.098Z",
        "lMod": "2023-03-13T06:01:49.000Z",
        "extractionType": "data",
        "extractionSourceId": "fs-47957dda-c46b-54ab-ac29-764fedc6f3a0",
        "_meta": {
            "state": "approved",
            "isDeleted": false,
            "updateAvailable": false,
            "contentSource": "manual"
        },
        "_source": {
            "sys_racl": [
                "*"
            ],
            "id": "1",
            "jobTitle": "Service Supervisor1",
            "emailAddress": "Gemma_Allen8451@sveldo.biz",
            "firstNameLastName": "Gemma Allen",
            "doc_id": "d-e66763e1-debf-51b6-945c-59df4724a7bd",
            "sys_content_type": "data",
            "sys_source_name": "Some Group Name"
        },
        "sourceHash": "eb8eb619e619970b65cb71c7450aa7b8",
        "__v": 0
    },
    {
        "_id": "fc-983074dd-9d92-533e-909f-bb309a3b1aab",
        "searchIndexId": "sidx-faf6e26a-e2f5-5493-9f62-778a059815f4",
        "streamId": "st-3b258741-511d-564e-a4c8-b69a2d62d5ea",
        "dataSourceGroupId": "dsg-87aeed73-d39e-57b7-ad28-a5eb7e6aed0a",
        "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "createdOn": "2023-03-13T06:01:49.098Z",
        "lMod": "2023-03-13T06:01:49.000Z",
        "extractionType": "data",
        "extractionSourceId": "fs-47957dda-c46b-54ab-ac29-764fedc6f3a0",
        "_meta": {
            "state": "approved",
            "isDeleted": false,
            "updateAvailable": false,
            "contentSource": "manual"
        },
        "_source": {
            "sys_racl": [
                "*"
            ],
            "id": "2",
            "jobTitle": "Service Supervisor2",
            "emailAddress": "Liv_Baker8412@jiman.org",
            "firstNameLastName": "Liv Baker",
            "doc_id": "d-51a2ba09-d422-5b6a-998a-0fd7c5226ffb",
            "sys_content_type": "data",
            "sys_source_name": "Some Group Name"
        },
        "sourceHash": "508dcf5c7576bca7720f81709f023a12",
        "__v": 0
    }
]

Sample Request(Single File):

{
  "documents": [
    {
      "fileId":"65c306c564e6d524e1544954"
    }
  ],
  "name": "Some Dir name"
}

Sample Request(Multiple Files):

{
  "documents": [
    {
      "fileId":"65c306c564e6d524e1544954"
    },
   {
      "fileId":"65c306c564e6d524e1544955"
    }
  ],
  "name": "Some Dir name"
}

Train API

Trains the SearchAssist application with all the ingested data or a specific data using the default Index and Search configuration.

  • Invoking Train API can be a costly operation since it processes all the available data. 
  • If index=true is sent as part of the Ingest API, then this API call is redundant. 
Method POST
Endpoint <host_url>/searchassistapi/external/stream/<enter-your-AppId-here>/train
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Train

Request Parameters

Parameters Description Mandatory
ContentIds List of one or more identifiers of the ingested content for which the application is to be trained. No, only used when the application needs to be trained for a specific set of data.

Sample Request( Train for a specific file)

{
  "contentIds": ["fc-8a634c5f-80e9-50aa-8e7c-a6914362d2be"]
}

Sample Response(All): 

{
    "hidden": false,
    "read": false,
    "status": "INPROGRESS",
    "percentageDone": 0,
    "timedOut": false,
    "_id": "fj-977caf7f-1663-5deb-a61c-b558b7011741",
    "createdOn": "2023-03-13T07:01:18.432Z",
    "jobType": "TRAINING",
    "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
    "title": "Training index 'Default Index'",
    "searchIndexId": "sidx-faf6e26a-e2f5-5493-9f62-778a059815f4",
    "streamId": "st-3b258741-511d-564e-a4c8-b69a2d62d5ea",
    "metadata": {
        "crawlerAck": false,
        "indexPipelineId": "fip-8a1ffeb2-1b9d-5b4e-b2a9-e415ad5968a8"
    },
    "startedAt": "2023-03-13T07:01:18.462Z",
    "lMod": "2023-03-13T07:01:18.462Z",
    "__v": 0
}

Add Index Fields

This API is used to create one or more index fields in the SearchAssist application. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization <JWT Token>
API Scope     Fields

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
indexPipelineId Provide the index configuration ID here. If this parameter is not passed, the index configuration marked as default in the application is used.  No
queryPipelineId Provide the search configuration ID here. If this parameter is not passed, the default search configuration in the application is used.  No

Request Parameters:

Parameters Description Mandatory
fields Array of field objects to be created in the application Each field object can have the following values:

“fieldName”: name for the field,

“fieldDataType”: data type of the field,

“isAutosuggest”: true/false,

“isSearchable”: true/false,

“weight”: the weightage to be assigned to this field during searches. This value can vary between 0 and 10. 

“presentable”: true/false

“highlight”: true/false

Note that only fieldName and fieldDataType are mandatory properties. The other properties are optional. When not provided, the field will have default values for these properties. 

Yes.

Sample Request

{
  "fields": [
    {
      "fieldName": "prod_category",
      "fieldDataType": "string",
      "isAutosuggest": true,
      "isSearchable": false,
      "weight": 8
    }
  ]
}

Sample Response:

 [{
    "_id": "fld-69121f6e-e225-59e5-acf9-db21307f0e7a",
    "searchIndexId": "sidx-1a03bc64-a17c-59f7-ba81-6a9be27a08db",
    "streamId": "st-bd0f08f4-56a9-542d-a7d0-ff57685664c9",
    "indexPipelineId": "fip-b59cf324-3504-5c8c-bc3d-94c93c70d3c5",
    "createdBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
    "lModifiedBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
    "createdOn": "2022-09-20T06:30:34.942Z",
    "lModifiedOn": "2022-09-20T06:30:34.000Z",
    "isSearchable": true,
    "isAutosuggest": true,
    "owner": "user",
    "fieldName": "Prod_category",
    "fieldDataType": "string",
    "presentable": true,
    "highlight": true,
    "weight": 8,
    "_v": 0
  }
]

Update Index Fields

This API is used to update the values for one or more index fields in the SearchAssist application. 

Method PUT
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

Parameters Description Mandatory
fields Array of field objects to be updated in the application. Each field object can have the following values:

“fieldId” : Unique identifier of the field. This is mandatory. 

“fieldName”: name for the field to be updated.

“fieldDataType”: data type of the field to be updated.

“isAutosuggest”: value to be updated. Set to true/false.

“isSearchable”: value to be updated.Set to true/false.

“weight”: value to be updated. Set to a value between 0 and 10. 

Yes.

Get Index Fields

This API is used to fetch the index fields from the SearchAssist application. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
indexPipelineId Unique identifier for the index configuration for which you want to fetch the indices.  No. When this field is not provided, the application will use default index configuration. 
skip This is the number of index records to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of index records to be fetched in each API call.  No. When not provided, the default value of 50 is used.

The parameters skip and limit are used to restrict the max number of index field records that are returned in a single call to this API. For example, if skip is set to 0 and limit is set to 10, the first 10 records are returned as response to the call. Similarly, if skip is set to 10 and limit is set to 5, 5 records starting from the 11th record are returned.   

Sample Response

"data": [
    {
      "_id": "fld-69121f6e-e225-59e5-acf9-db21307f0e7a",
      "searchIndexId": "sidx-1a03bc64-a17c-59f7-ba81-6a9be27a08db",
      "streamId": "st-bd0f08f4-56a9-542d-a7d0-ff57685664c9",
      "indexPipelineId": "fip-b59cf324-3504-5c8c-bc3d-94c93c70d3c5",
      "createdBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
      "lModifiedBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
      "createdOn": "2022-09-20T06:30:34.942Z",
      "lModifiedOn": "2022-09-20T06:30:34.000Z",
      "isSearchable": true,
      "isAutosuggest": true,
      "owner": "user",
      "fieldName": "Prod_category",
      "fieldDataType": "string",
      "presentable": true,
      "highlight": true,
      "weight": 8,
      "_v": 0
    }
  ],
  "totalCount": 1,
  "hasMore": false
}

Delete Index Fields

This API is used to delete index fields from the SearchAssist application. 

Method DELETE
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
indexPipelineId Unique identifier for the index configuration for which you want to fetch the indices.  No. When this field is not provided,default index configuration is used. 
queryPipelineId Unique identifier for the search configuration. This will be used to delete the corresponding attributes from the search configuration. No. When not provided, default search configuration is used. 

Request Parameters

Parameters Description Mandatory
fieldIds Array of unique identifiers of the index fields to be deleted.  The index field identifiers begin with ‘fld’ and are returned as value of key ‘_id’ in response to get Index fields API.  Yes.

Edit Index Field by Id

This API is used to edit a specific index field in the SearchAssist application. 

Method PUT
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields/<fieldId>
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
fieldId Unique Identifier of the Index field to be updated. Yes

Request Parameters

Parameters Description Mandatory
fields Field object to be updated in the application. The field object should have the values to be updated in the application. You can update one or more of the following values of a field. 

“fieldName”: name for the field to be updated.

“fieldDataType”: data type of the field to be updated.

“isAutosuggest”: value to be updated. Set this to true/false.

“isSearchable”: value to be updated.Set this to true/false.

“weight”: value to be updated. Set this to a number between 0 and 10. Higher the number, more is the weightage of the field. 

“presentable”:  value to be updated.Set this to true/false.

“Highlight”:  value to be updated.Set this to  true/false.

Yes.

Get Index Field by Id

This API is used to fetch a specific index field from the SearchAssist application. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields/<fieldId>
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
fieldId Unique Identifier of the Index field to be updated. Yes

Get Content

This API is used to fetch the content records from the SearchAssist application.  Currently, this API only supports structured data. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/content
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Content

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
skip Number of documents to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of records to be fetched as response to the API call, starting with a record after the skip count. No. When not provided, the default value of 50 is used.

The parameters skip and limit are used to restrict the max number of index records that are returned in a particular API call. For example, if skip is set to 0 and limit is set to 10, the first 10 records are returned as response to the call. If,  skip is set to 10 and limit is set to 5, 5 records starting from the 11th record are returned.  

Sample Response

{
    "data": [
        {
            "_id": "fc-e9749c38-3427-5a4e-96b9-f6898996dbcd",
            "searchIndexId": "sidx-3752fcd3-8572-5c91-a988-e6e1e6f89ab0",
            "extractionSourceId": "fs-5bb62969-6782-5c7c-aad6-95e64d18f839",
            "streamId": "st-abc4a25d-f740-578a-9cda-620e92575211",
            "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "createdOn": "2024-01-04T07:15:59.594Z",
            "lMod": "2024-01-04T07:15:59.000Z",
            "extractionType": "data",
            "_meta": {
                "state": "approved",
                "isDeleted": false,
                "updateAvailable": false,
                "fileName": "f-9aad1ef0-1d4f-591f-b2f7-2b0c3877c3cd",
                "contentSource": "file"
            },
            "_source": {
                "sys_racl": [
                    "*"
                ],
                "sno": "10",
                "product": "Xerox 198",
                "name": "Dorothy Badders",
                "value1": "678",
                "value2": "-226.36",
                "value3": "4.98",
                "value4": "8.33",
                "desc": "Nunavut",
                "type": "Paper",
                "quality": "0.38",
                "doc_id": "d-2a6a8845-f7da-5fd5-b356-aa7f62c56101",
                "sys_content_type": "data",
                "sys_source_name": "Default Structured Data File Source"
            },
            "dataSourceGroupId": "dsg-eb43977b-2769-5836-846b-b841c14fc2f2",
            "subscriptionId": "fsub-047387b0-199f-5d9b-8e51-d0474b14825f",
            "sourceHash": "4d3118b8248d17f8279f2b9c1b143bce",
            "__v": 0,
            "userDetails": {
                "fullName": "Documentation"
            },
            "modUserDetails": {
                "fullName": "Documentation"
            }
        },
        {
            "_id": "fc-75d9e059-7934-5578-b417-a84d7fbe4a07",
            "searchIndexId": "sidx-3752fcd3-8572-5c91-a988-e6e1e6f89ab0",
            "extractionSourceId": "fs-5bb62969-6782-5c7c-aad6-95e64d18f839",
            "streamId": "st-abc4a25d-f740-578a-9cda-620e92575211",
            "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "createdOn": "2024-01-04T07:15:59.593Z",
            "lMod": "2024-01-04T07:15:59.000Z",
            "extractionType": "data",
            "_meta": {
                "state": "approved",
                "isDeleted": false,
                "updateAvailable": false,
                "fileName": "f-9aad1ef0-1d4f-591f-b2f7-2b0c3877c3cd",
                "contentSource": "file"
            },
            "_source": {
                "sys_racl": [
                    "*"
                ],
                "sno": "8",
                "product": "SAFCO Mobile Desk Side File, Wire Frame",
                "name": "Carl Jackson",
                "value1": "613",
                "value2": "127.7",
                "value3": "42.76",
                "value4": "6.22",
                "desc": "Nunavut",
                "type": "Storage & Organization",
                "quality": "",
                "doc_id": "d-364e798b-228b-5fe5-8417-4e8784883b83",
                "sys_content_type": "data",
                "sys_source_name": "Default Structured Data File Source"
            },
            "dataSourceGroupId": "dsg-eb43977b-2769-5836-846b-b841c14fc2f2",
            "subscriptionId": "fsub-047387b0-199f-5d9b-8e51-d0474b14825f",
            "sourceHash": "f79acf3e664e7c18c8439886a62a01f2",
            "__v": 0,
            "userDetails": {
                "fullName": "Documentation"
            },
            "modUserDetails": {
                "fullName": "Documentation"
            }
        },
    ],
    "total": 2,
    "hasMore": false
}

Delete Content

This API is used to delete ingested content from the SearchAssist application.  Currently, this API supports structured data and files. Once the data is deleted from the application, it is no longer available for search. 

Method DELETE
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/content
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Content

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

 

Parameters Description Mandatory
docIDs Array of identifiers of the records to be deleted from the application. Please note that this id is available as doc_id and starts with “d-”.

Use this field for structured data.

No.
contentIds Array of file identifiers which are to be deleted from the application. Note that this id is presented as contentid and starts with ‘fc-”.

Use this for files.

No.

Sample Request(Structured Data)

{
  "docIds": [
    "d-2a6a8845-f7da-5fd5-b356-aa7f62c56101"
  ]
}

Sample Response(Structured Data)

{
    "n": 1,
    "ok": 1,
    "deletedCount": 1
}

Get Content by Condition

This API can be used to fetch specific content records from the SearchAssist application. The records to be fetched are specified using conditions in the request body. You can use any of the index fields for which the data is trained, to specify the condition. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/get-content-by-condition
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Content

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
skip Number of documents to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of records to be fetched as response to the API call, starting with a record after the skip count. No. When not provided, the default value of 50 is used.

The parameters skip and limit are used to restrict the maximum number of records that are returned in an API call. For example, if the skip parameter is set to 0 and the limit is set to 10, the first 10 records are returned as the response to the call. If,  skip is set to 10 and the limit is set to 5, 5 records starting from the 11th record are returned.  

Request Parameters

Parameters Description Mandatory
query Array of conditions on the basis of which content is to be filtered. Yes.

Sample Request

To fetch all the web pages from the ingested content:

{
  "query": {
    "sys_content_type": "web"
  }
}

Import Index Configuration

This API can be used to import one or more index configurations to the SearchAssist application. 

 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/indexPipeline/import
Content Type application/json
Auth <JWT Token>
API Scope     App Settings

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Sample Request

{
    "appVersion": "1.1.0",
    "indexSettings": [
        {
            "name": "Default Index",
            "fields": [
                {
                    "isSearchable": true,
                    "isAutosuggest": false,
                    "owner": "user",
                    "fieldName": "faq_question_vector",
                    "fieldDataType": "dense_vector"
                },
               ...<more fields>,
           ],
            "settings": {
                "language": {
                    "enable": true,
                    "values": [
                        {
                            "language": "English",
                            "languageCode": "en",
                            "default": true
                        }
                    ]
                }
            },
            "stages": [
                {
                    "config": {
                        "mappings": [
                            {
                                "source_field": "faq_question",
                                "target_field": "faq_question_keywords",
                                "model": "topic_rank"
                            }
                        ]
                    },
                    "name": "FAQ Keyword Extraction",
                    "enable": true,
                    "type": "keyword_extraction",
                    "condition": {
                        "type": "basic",
                        "mappings": [
                            {
                                "value": [
                                    "faq"
                                ],
                                "operator": "equalsTo",
                                "fieldName": "sys_content_type"
                            }
                        ]
                    }
                },
                {
                    "config": {
                        "mappings": [
                            {
                                "source_field": "page_title",
                                "target_field": "page_title_keywords",
                                "model": "position_rank"
                            }
                        ]
                    },
                    "name": "Webdomain Keyword Extraction",
                    "enable": true,
                    "type": "keyword_extraction",
                    "condition": {
                        "type": "basic",
                        "mappings": [
                            {
                                "value": [
                                    "web"
                                ],
                                "operator": "equalsTo",
                                "fieldName": "sys_content_type"
                            }
                        ]
                    }
                },
                {
                    "config": {
                        "mappings": [
                            {
                                "source_field": "faq_question",
                                "target_field": "faq_question_vector",
                                "model": ""
                            },
                            {
                                "source_field": "page_title",
                                "target_field": "page_title_vector",
                                "model": ""
                            },
                            {
                                "source_field": "file_title",
                                "target_field": "file_title_vector",
                                "model": ""
                            }
                        ]
                    },
                    "name": "Default: Semantic Meaning",
                    "enable": true,
                    "type": "semantic_meaning",
                    "condition": {
                        "type": "basic",
                        "mappings": [
                            {
                                "value": [
                                    "faq",
                                    "web",
                                    "file"
                                ],
                                "operator": "contains",
                                "fieldName": "sys_content_type"
                            }
                        ]
                    }
                }
            ],
            "traits": [],
            "searchConfiguration": [
                {
                    "facets": [
                        {
                            "multiselect": false,
                            "active": true,
                            "showFieldWarning": false,
                            "type": "tab",
                            "tabs": [
                                {
                                    "fieldValue": "web",
                                    "bucketName": "Web Results"
                                },
                                {
                                    "fieldValue": "file",
                                    "bucketName": "Files"
                                },
                                {
                                    "fieldValue": "data",
                                    "bucketName": "Structured Data"
                                },
                                {
                                    "fieldValue": "faq",
                                    "bucketName": "FAQs"
                                }
                            ],
                            "name": "Default Tab Facet",
                            "fieldName": "sys_content_type"
                        }
                    ],
                    "fqpSettings": {
                        "name": "Default Search",
                        "default": true,
                        "facetOrder": [],
                        "settings": {
                            "weight": {
                                "enable": true,
                                "fieldValues": [
                                    "faq_question_vector",
                                    "page_preview",
                                    ...<more fields>,
                                    "page_title_keywords"
                                ]
                            },
                            "presentable": {
                                "enable": true,
                                "fieldValues": [
                                    "page_preview",
                                    "sys_source_name",
                                    "contentGroup",
                                    "file_title",
                                    "page_url",
                                    "doc_id",
                                    "page_image_url"
                                ]
                            },
                            "highlight": {
                                "highlightAppearance": {
                                    "preTag": "<span class=\"highlightText\">",
                                    "postTag": "</span>"
                                },
                                "enable": true,
                                "synonymsHighlight": true,
                                "fieldValues": [
                                    "page_preview",
                                    "faq_cond_answers",
                                    "faq_answer",
                                    "file_preview",
                                    "content"
                                ]
                            },
                            "spellCorrect": {
                                "enable": true,
                                "minCharThreshold": 4,
                                "maxTypoEdits": 2,
                                "fieldValues": [
                                    "page_preview",
                                    "page_body",
                                    "file_preview",
                                    "content",
                                    "title"
                                ]
                            },
                            "prefixSearch": {
                                "enable": false,
                                "type": "prefixAny",
                                "fieldValues": [
                                    "file_title",
                                    "title",
                                    "faq_question",
                                    "page_title"
                                ]
                            },
                            "searchRelevance": {
                                "enable": false,
                                "matchThreshold": 30,
                                "languages": [
                                    {
                                        "enable": false,
                                        "languageCode": "en",
                                        "verb": false,
                                        "subject": false,
                                        "object": false
                                    }
                                ]
                            },
                            "botActions": {
                                "enable": true,
                                "executeIntents": false
                            },
                            "stopwords": {
                                "enable": true,
                                "languageCodes": []
                            },
                            "synonyms": {
                                "enable": true,
                                "languageCodes": []
                            },
                            "smallTalk": {
                                "enable": true
                            },
                            "customConfiguration": {
                                "enable": true,
                                "values": []
                            }
                        }
                    },
                    "searchFields": [
                        {
                            "weight": {
                                "value": 2
                            },
                            "spellCorrect": {
                                "value": false
                            },
                            "presentable": {
                                "value": false
                            },
                            "highlight": {
                                "value": false
                            },
                            "prefixSearch": {
                                "value": false
                            },
                            "fieldName": "faq_question_vector"
                        },
                        ...<more searchable fields>,
                    ],
                    "synonyms": [],
                    "stopwords": [],
                    "answerSnippets": {
                        "config": [
                            {
                                "type": "extractive_model",
                                "active": false,
                                "similarityScore": 60,
                                "enabledFirstTime": true,
                                "workBenchStageFound": false,
                                "workBenchStageEnabled": false,
                                "searchFields": [
                                    {
                                        "fieldName": "snippet_title",
                                        "weight": 5
                                    },
                                    {
                                        "fieldName": "snippet_content",
                                        "weight": 3
                                    }
                                ]
                            },
                            {
                                "type": "generative_model",
                                "active": false,
                                "apiKeyRef": "",
                                "numberOfChunks": 5,
                                "temperature": 0.5,
                                "similarityScore": 40
                            }
                        ]
                    },
                    "prompts": [],
                    "entities": [
                        {
                            "entityType": "system_defined",
                            "entityName": "Date"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Time"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Location"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "GeoPoliticalEntities"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Company Name or Organization"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Currency"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Person Name"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Number"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Percentage"
                        }
                    ],
                    "rules": [],
                    "searchExperience": {
                        "searchInterface": {
                            "experienceConfig": {
                                "searchBarPosition": "bottom"
                            },
                            "widgetConfig": {
                                "searchBarFillColor": "#FFFFFF",
                                "searchBarBorderColor": "#E4E5E7",
                                "searchBarPlaceholderText": "Type here to search",
                                "searchBarPlaceholderTextColor": "#3C4043",
                                "searchButtonEnabled": false,
                                "buttonText": "BUTTON",
                                "buttonTextColor": "#BDC1C6",
                                "buttonFillColor": "#EFF0F1",
                                "buttonBorderColor": "#EFF0F1",
                                "userSelectedColors": [
                                    "#202124",
                                    "#7027E5",
                                    "#FFFFFF"
                                ],
                                "buttonPlacementPosition": "outside",
                                "searchBarIcon": ""
                            },
                            "interactionsConfig": {
                                "welcomeMsg": "Hi, How can I help you?",
                                "welcomeMsgColor": "#3C4043",
                                "showSearchesEnabled": true,
                                "showSearches": "frequent",
                                "autocompleteOpt": true,
                                "querySuggestionsLimit": 3,
                                "liveSearchResultsLimit": 0,
                                "feedbackExperience": {
                                    "queryLevel": false,
                                    "smartAnswer": false,
                                    "lmod": "2023-11-30T02:01:56.641Z"
                                },
                                "defaultStatus": "searchBar",
                                "welcomeMsgFillColor": "#EFF0F1"
                            }
                        },
                        "resultViewSettings": [
                            {
                                "facetsSetting": {
                                    "enabled": true,
                                    "aligned": "left"
                                },
                                "view": "fit",
                                "groupResults": true,
                                "interface": "liveSearch",
                                "groupSetting": {
                                    "conditions": [
                                        {
                                            "op": "equals",
                                            "fieldValue": "web",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Web Pages",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "page_title",
                                                    "description": "page_preview",
                                                    "img": "page_image_url",
                                                    "url": "page_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        }
                                    ],
                                    "fieldName": "sys_content_type"
                                },
                                "defaultTemplate": {
                                    "type": "list",
                                    "layout": {
                                        "renderTitle": false,
                                        "isClickable": false,
                                        "textAlignment": "left",
                                        "layoutType": "l3",
                                        "listType": "plain"
                                    },
                                    "mapping": {
                                        "heading": "",
                                        "description": "",
                                        "img": "",
                                        "url": "",
                                        "description1": "",
                                        "label1": "",
                                        "label2": "",
                                        "strikedOffRate": "",
                                        "rateField": "",
                                        "rating": "",
                                        "textField1": "",
                                        "textField2": "",
                                        "icon": "",
                                        "chips": ""
                                    }
                                }
                            },
                            {
                                "facetsSetting": {
                                    "enabled": true,
                                    "aligned": "left"
                                },
                                "view": "fit",
                                "groupResults": true,
                                "interface": "fullSearch",
                                "groupSetting": {
                                    "conditions": [
                                        {
                                            "op": "equals",
                                            "fieldValue": "web",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Web Pages",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "page_title",
                                                    "description": "page_preview",
                                                    "img": "page_image_url",
                                                    "url": "page_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        },
                                        {
                                            "op": "equals",
                                            "fieldValue": "faq",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": false,
                                                    "textAlignment": "left",
                                                    "layoutType": "l3",
                                                    "title": "FAQs",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "faq_question",
                                                    "description": "faq_answer",
                                                    "img": "",
                                                    "url": "",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        },
                                        {
                                            "op": "equals",
                                            "fieldValue": "file",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Files",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "file_title",
                                                    "description": "file_preview",
                                                    "img": "file_image_url",
                                                    "url": "file_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        }
                                    ],
                                    "fieldName": "sys_content_type"
                                },
                                "defaultTemplate": {
                                    "type": "list",
                                    "layout": {
                                        "renderTitle": false,
                                        "isClickable": false,
                                        "textAlignment": "left",
                                        "layoutType": "l3",
                                        "listType": "plain"
                                    },
                                    "mapping": {
                                        "heading": "",
                                        "description": "",
                                        "img": "",
                                        "url": "",
                                        "description1": "",
                                        "label1": "",
                                        "label2": "",
                                        "strikedOffRate": "",
                                        "rateField": "",
                                        "rating": "",
                                        "textField1": "",
                                        "textField2": "",
                                        "icon": "",
                                        "chips": ""
                                    }
                                }
                            },
                            {
                                "facetsSetting": {
                                    "enabled": true,
                                    "aligned": "left"
                                },
                                "view": "fit",
                                "groupResults": true,
                                "interface": "conversationalSearch",
                                "groupSetting": {
                                    "conditions": [
                                        {
                                            "op": "equals",
                                            "fieldValue": "web",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Web Pages",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "page_title",
                                                    "description": "page_preview",
                                                    "img": "page_image_url",
                                                    "url": "page_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        }
                                    ],
                                    "fieldName": "sys_content_type"
                                },
                                "defaultTemplate": {
                                    "type": "list",
                                    "layout": {
                                        "renderTitle": false,
                                        "isClickable": false,
                                        "textAlignment": "left",
                                        "layoutType": "l3",
                                        "listType": "plain"
                                    },
                                    "mapping": {
                                        "heading": "",
                                        "description": "",
                                        "img": "",
                                        "url": "",
                                        "description1": "",
                                        "label1": "",
                                        "label2": "",
                                        "strikedOffRate": "",
                                        "rateField": "",
                                        "rating": "",
                                        "textField1": "",
                                        "textField2": "",
                                        "icon": "",
                                        "chips": ""
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}

Export Index Configuration

This API can be used to export all the index configurations present in the SearchAssist application. The index configurations are provided as an array of JSON objects. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/indexPipeline/export
Content Type application/json
Auth <JWT Token>
API Scope  App Settings

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
skip Number of documents to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of records to be fetched as response to the API call, starting with a record after the skip count. No. When not provided, the default value of 50 is used.

History

This API can be used to fetch the logs corresponding to a user’s interaction with the SearchAssist application. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/history
Content-Type application/json
Auth <JWT Token>
API Scope     Analytics

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

Parameters Description Mandatory
clientId Unique client Id for the application Yes
userIdentity Unique user Id for the user whose history is to be fetched.  Yes

Sample Request

{
  "userConfig": {
    "clientId": "cs-***",
    "userIdentity": "u-4e0c8e48-0126-51bb-bb74-********"
  }
}

UploadFile

This API can be used to upload a file to a server. Note that to ingest this file in the SearchAssist application, use the ingest API. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/uploadfile
Content-Type multipart/form-data
Auth <JWT Token>
API Scope     Ingest Data

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

Parameters Description Mandatory
file File in Binary format  Yes
fileExtension The extension of the file (must be string) No
fileContext The location where the file is to be saved on the application. Currently, it only supports the default location. Set this field to ‘findly’. Yes
filename Name of the file as it is to be saved on the application. No
Content-Type Content type No

Sample Response

On successful file upload, the response provides the fileId. This fileId can be used to invoke ingest API if the file needs to be ingested into the SearchAssist application.  

{
    "fileId": "65c306c564e6d524e1544954",
    "hash": "c0ebc08aeae58a1bfdd036b501eef8f732bb2867"
}

Incremental Web Crawling

This API can be used to add a crawl and index a web page to a given web source without making changes to the existing configuration or recrawling the existing pages. If the web page that is passed as input to the API already exists in the web source, it is recrawled. Else, it is added as a new page to the source.

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/ingest?streamId=<streamId>&contentSource=<content-source-value>&extractionType=<extraction-type-value>&index=<index-value>
Content-Type application/json
Authorization auth: <JWT Token>
API Scope     Ingest Data

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
contentSource Source of the data. Set this to ‘manual’. Yes
extractionType Type of data expected in the request body. Set this to ‘web’. Yes
index This parameter tells the application to train the application for the ingested web page. If this field is set to true, the SearchAssist application is trained with the ingested data immediately.  Note that the training is done using the default Index and Search Configurations set at the time of invoking the API.  When set to false, you have to run the training operation separately.  Yes

Request Parameters

Parameters Description Mandatory
name Name of the web source to which the web page is to be added.   Yes
documents Array of objects containing the URL of the web pages. Refer to the below sample request for format.   Yes 

Sample Request:

    {
        “documents”: [
            {
                “url”: https://kore.ai/itassist/”]
            }
        ],
        “name”:“kore”
    }
    

Response:

On successful crawling of the web page, you can see the indexed content from the page in the response. 

Points to Note:

  • When a new page is added to the web source through this API, performing a manual recrawl through the application or using the scheduler could result in the deletion of the page from the index, depending on the configuration of web source. If the page URL is also added to the web source’s sitemap, it will be created. Else, it will not be recrawled.  

For example, 

Scenario 1: Assume we add a new page, such as “https://kore.ai/searchassist,” to an existing web source named “kore” using this API. In the initial crawler run, if the page was not crawled because max url limit which was set to 10, was reached, it is highly probable that it will be skipped in the subsequent run as well. Hence, when you manually recrawl the web source, the new page will be deleted. 

Scenario 2: Assume an existing crawl configuration for the same web source has  depth=0 and maxurl=0, which implies that it should crawl the entire sitemap. In this case, if the web source is manually crawled again, the new page will be recrawled, given that it is part of the sitemap. 

  • You can add only one web page at a time using this incremental web crawl. 
  • If the name of the source does not match any of the existing source names in the application, the API will throw an error. 
  • The crawl configuration options set for the web source do not apply to the newly added web page. 

Fetch Debug Information 

This API is used to retrieve debug information corresponding to the answers and search results returned in response of the previous fullsearch or advancedSearch request.  In other words, invoke the search API to get your answers and then follow up with the answer-debug API to get the corresponding debug information. 

The API returns information about both answers and search results. Corresponding to the answers, it returns information like  the type of model used for answer generation, the retrieved and the qualified chunks for each model, the LLM properties and the LLM response in case of generative answers, and other important debug parameters. Corresponding to the search results, it returns information like search scores for the search results, config details, etc. 

It’s important to note that the time gap between the search API call and the answer debug API call must not exceed 600 seconds.

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/debug-answer
Content-Type application/json
Authorization auth: <JWT Token>
API Scope   Full Search

Request Parameters

Parameters Description Mandatory
queryPipelineId Search configuration Id. This is available as ‘queryPipelineId’ in the response of the search API invoked.  Yes
searchRequestId This field is available as ‘requestId’ in the response of the search API invoked.  Yes 

Sample Request:

{
  “queryPipelineId”: “fqp-b440ff10-365e-5c58-a4e8-650ce9ee6ab6”,
  “searchRequestId”: “fsh-d5460843-ff20-50f8-a70b-bd3f5083d6f2”
}

Feedback API

This API is used to update user feedback to an answer in the SearchAssist application. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/feedback
Content-Type application/json
Authorization auth: <JWT Token>
API Scope Analytics

 Query Parameters:

streamID: Provide your application ID here. 

Request Parameters:

Parameters Description Mandatory
feedback This field describes the type of results for which the feedback is being provided. It can take the following values: 1 for search results and 2 for answer Yes
type This field is the actual feedback for the answer or search result. It can take the following values:
1 for positive feedback or thumbsUp and 2 for negative feedback or thumbsDown.
Yes 
searchRequestId This field is available as ‘requestId’ in the response of the search API invoked.   Yes
Comments This field can be used to pass additional comments along with the feedback. It is in JSON format as shown in the example below, 

“comments”: {

    “text”: “comment “,

    “issueType”: “incorrect”

  }

Here, the ‘text’ field contains the comment text to append to the feedback, while issueType may be one of the following options: incorrect, outdated, few_results, or other.

No

Sample Request 

{
  "feedback": 1,
  "type": 1,
  "searchRequestId": "search requestId",
  "comments": {
    "text": "comment ",
    "issueType": "incorrect"
  }
}

API List

Full Search API

This API is used to fetch search results and answers generated corresponding to the input query. This API returns results from all the data ingested into the SearchAssist application.  

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fullsearch
Content Type application/json
Authorization auth: <JWT Token>
API Scope       Full Search

Query Parameters:

 streamID: Provide your application ID here. 

 Request Parameters:

 

Parameters Description Mandatory
query Query string for search Yes
maxNumOfResults Maximum number of results to be returned in the response. Yes
lang The language used for the query. No. By default, this is set to English.
customData Custom data to be sent in the request. This data can be used to further process or filter the search results in the application.  For example, you can use this field to set user context like user identity, location, etc. No
SearchSettings Search settings to be applied to the fields. Default search configuration of the application is overridden when searchsettings are provided. No
includeChunksInResponse This can be set to true or false. When set to true and if answers snippets are enabled, the response will also have the list of qualified chunks along with other parameters. The chunk information is stored in chunk_result

Field in the response.

No
IncludeMetaDataAnswers This field can fetch specific chunk metadata fields in the Answer along with the default fields. The requested fields are returned as part of the graph_answer field in the response. For instance, to fetch the author name(a metadata field) and subtitle(a custom field) additionally from the chunks, include the following in the request payload. “IncludeMetaDataAnswers”: [“chunkMeta.author”, “subtitle”].

Note:
1. For metadata fields, use the field name along with the root name, such as chunkMeta.<x>, as shown in the above example.
2. If a metadata field listed in this object does not exist, the field is returned with a null value.
No
IncludeMetaDataSearchResults This parameter accepts an array that lists the specific fields to be included in the response, along with the default fields. The fields are returned in the results field in the response.

For example : to fetch the title and url from the meta fields, set the field as shown below. 

“IncludeMetaDataSearchResults”: [“meta_data.title”, “meta_data.url”]

No

Sample Request 

{
  "query": "national pension scheme",
  "maxNumOfResults": 2
}

Sample Response 

{
    "templateType": "search",
    "requestId": "fsh-cf761dfc-f838-5004-a0ff-9dc8e2782427",
    "template": {
        "originalQuery": "national pension scheme",
        "spellCorrectedQuery": "national pension scheme",
        "results": {
            "web": {
                "data": [
                    {
                        "contentId": "fc-e0b42267-0c7f-4aab-a539-6ebfedff9bd6",
                        "sys_content_type": "web",
                        "score": 125.62481,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://searchassist-qa.kore.ai/searchassistapi/redirect?rurl=https%3A%2F%2Fwww.paytmmoney.com%2Fnps-national-pension-scheme&requestId=fsh-cf761dfc-f838-5004-a0ff-9dc8e2782427&contentId=fc-e0b42267-0c7f-4aab-a539-6ebfedff9bd6&hId=87b209cfa9a2b8720df2138a116915ea540f42e637bf95abf1122b55cc52e032",
                        "sys_source_name": "paytm money",
                        "page_title": "National Pension Scheme - NPS Scheme, Online Account Opening & Contibution",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:36.042000",
                        "page_preview": "NPS / National Pension Scheme is a smart way to accumulate a retirement corpus for yourself in an effective manner. Know about NPS scheme features, benefits & contribution under Section 80C."
                    },
                    {
                        "contentId": "fc-374d9c6c-1afe-4d19-8078-7f4dd12f05f6",
                        "sys_content_type": "web",
                        "score": 14.741463,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://searchassist-qa.kore.ai/searchassistapi/redirect?rurl=https%3A%2F%2Fwww.paytmmoney.com%2F&requestId=fsh-cf761dfc-f838-5004-a0ff-9dc8e2782427&contentId=fc-374d9c6c-1afe-4d19-8078-7f4dd12f05f6&hId=c8b24d6dfbdc8d8ae08167366feb09719cc9b5fe75e0531d7646e557d80fd098",
                        "sys_source_name": "paytm money",
                        "page_title": "Paytm Money - Online Demat Account, Trading, Direct Mutual Funds & NPS",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:33.981000",
                        "page_preview": "Open online demat account & start your stocks trading journey. Invest in best direct mutual funds with zero commission. Save taxes & enjoy regular pension income with NPS only on Paytm Money."
                    }
                ],
                "doc_count": 7
            }
        },
        "facets": [],
        "tabFacet": {
            "fieldName": "sys_content_type",
            "buckets": [
                {
                    "key": "web",
                    "doc_count": 7,
                    "name": "Web Results"
                }
            ]
        },
        "resultType": "grouped",
        "graph_answer": {
            "payload": []
        },
        "query_language": "en"
    },
    "relay": "default",
    "queryPipelineId": "fqp-b2dec185-2162-509d-a07e-49657625b155",
    "indexPipelineId": "fip-8a1ffeb2-1b9d-5b4e-b2a9-e415ad5968a8"
}

Live Search API

This API dynamically fetches search results from the SearchAssist application based on the input query. The API returns relevant results from all the data ingested into the application. 

Note: The API does not return answers as part of the response.
Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/livesearch
Content Type application/json
Authorization auth: <JWT Token>
API Scope       Live Search

Query Parameters:

streamId: Provide your application ID here. 

Request Parameters:

Parameters Description Mandatory
query Query string for search Yes
maxNumOfResults Maximum number of results to be returned in the response. Yes
lang The language used for the query. No. By default, this is set to English.
customData Custom data to be sent in the request. This data can be used to further process or filter the search results in the application.  For example, you can use this field to set user context like user identity, location, etc. No
SearchSettings This field allows you to set the search settings to be applied before returning the search results. These fields override the default search configuration of the SearchAssist application. Refer to the request payload shown below to learn about the usage. No

Sample Request:

{
  "query": "national pension scheme",
  "maxNumOfResults": 2
}

Sample Response:

{
    "templateType": "liveSearch",
    "requestId": "fsh-b746d2fb-51ff-5108-b8bd-f34275215fbe",
    "template": {
        "originalQuery": "national pension scheme",
        "spellCorrectedQuery": "national pension scheme",
        "results": {
            "web": {
                "data": [
                    {
                        "contentId": "fc-e0b42267-0c7f-4aab-a539-6ebfedff9bd6",
                        "sys_content_type": "web",
                        "score": 125.62481,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://www.paytmmoney.com/nps-national-pension-scheme",
                        "sys_source_name": "paytm money",
                        "page_title": "National Pension Scheme - NPS Scheme, Online Account Opening & Contibution",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:36.042000",
                        "page_preview": "NPS / National Pension Scheme is a smart way to accumulate a retirement corpus for yourself in an effective manner. Know about NPS scheme features, benefits & contribution under Section 80C."
                    },
                    {
                        "contentId": "fc-374d9c6c-1afe-4d19-8078-7f4dd12f05f6",
                        "sys_content_type": "web",
                        "score": 14.741463,
                        "keywords": [],
                        "config": {
                            "pinIndex": -1,
                            "boost": 1,
                            "visible": true
                        },
                        "addedResult": false,
                        "customization": {},
                        "score_debug": {},
                        "page_url": "https://www.paytmmoney.com/",
                        "sys_source_name": "paytm money",
                        "page_title": "Paytm Money - Online Demat Account, Trading, Direct Mutual Funds & NPS",
                        "page_image_url": "https://www.paytmmoney.com/share.png",
                        "sys_racl": [
                            "*"
                        ],
                        "createdOn": "2023-03-02T07:55:33.981000",
                        "page_preview": "Open online demat account & start your stocks trading journey. Invest in best direct mutual funds with zero commission. Save taxes & enjoy regular pension income with NPS only on Paytm Money."
                    }
                ],
                "doc_count": 7
            }
        },
        "facets": [],
        "tabFacet": {
            "fieldName": "sys_content_type",
            "buckets": [
                {
                    "key": "web",
                    "doc_count": 7,
                    "name": "Web Results"
                }
            ]
        },
        "resultType": "grouped",
        "graph_answer": {
            "payload": {}
        },
        "query_language": "en"
    },
    "relay": "default",
    "queryPipelineId": "fqp-b2dec185-2162-509d-a07e-49657625b155",
    "indexPipelineId": "fip-8a1ffeb2-1b9d-5b4e-b2a9-e415ad5968a8"
}

 

Auto Suggestions API

Returns predictions related to the query data in response to an HTTP request. It can be used to provide autocomplete functionality for text-based search functionality. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<enter-your-AppId-here>/autosuggestion
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Auto Suggestions

Request Parameters:

Parameters Description Mandatory
query Query string for search Yes
maxNumOfResults Maximum number of results to be returned in the response. Yes
lang The language used for the query. No. By default, this is set to English.

Sample Request:

{
"query": "mutual funds",
"maxNumOfResults": 4,
"lang": "en" 
}

Sample Response:

{
    "requestId": "sr-a2c28109-83c8-49a3-8eee-e6c893f0e8ba",
    "originalQuery": "mutual funds",
    "autoComplete": {
        "querySuggestions": [
            "Paytm Money - Online Demat Account, Trading, Direct Mutual Funds & NPS",
            "Invest In Best Direct Mutual Funds In India | Paytm Money",
            "Advantages of Mutual Funds - Benefits of Investing in Mutual Funds",
            "Zero Pricing | Unlimited Buying & Selling of Mutual Funds for Free - Paytm Money"
        ],
        "typeAheads": [
            "funds &"
        ]
    }
}

Ingest Data API

This API is used to ingest data into the SearchAssist application. Currently, the feature is limited to ingesting structured data or files. Note that answers will be generated from this structured data only if the ingested content has ‘title’ and ‘content’ as keys in the object.  

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<enter-your-AppId-here>/ingest?contentSource=<content-source-value>&extractionType=<extraction-type-value>&index=<index-value>
Content Type application/json
Authorization auth: <JWT Token>
API Scope Ingest Data

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here. Yes
contentSource Source of the data. Set this to ‘manual’. Yes
extractionType Type of data expected in the requested body. For structured data, set this field to ‘data’, for ingesting files, set this to ‘file’. Yes
index This parameter tells the application to train the application for the ingested data. If this field is set to true, the SearchAssist application is trained with the ingested data immediately.  Note that the training is done using the default Index and Search Configurations set at the time of invoking the API.  When set to false, you have to run the training operation separately. Yes

Request Parameters

Parameters Description Mandatory
name Name given to the ingested data. This is used internally by the searchassist application.  Yes
documents Array of objects containing structured data or files. 

For Structured Data:

If there is a ‘doc_id’ field in the object, it is used as an identifier for the object in SearchAssist. If this field is not provided in the object, it is auto-generated by SearchAssist when this object is ingested.

For Files:

Provide the ‘fileId’ for the uploaded file that needs to be ingested into the application.   This fileId is generated when the file is uploaded to the SearchAssist application server. Check uploadfile API below for more details.

Yes 

Sample Request(Structured Data):

{
  "name": "Some Group Name",
  "documents": [{
      "id": "1",
      "jobTitle": "Service Supervisor1",
      "emailAddress": "Gemma_Allen8451@sveldo.biz",
      "firstNameLastName": "Gemma Allen"
  },
  {
      "id": "2",
      "jobTitle": "Service Supervisor2",
      "emailAddress": "Liv_Baker8412@jiman.org",
      "firstNameLastName": "Liv Baker"
  }]
}

Sample Response(Structured Data):

[
    {
        "_id": "fc-dd2ba8bb-2c01-5ff4-bc89-2e3e31b2ff20",
        "searchIndexId": "sidx-faf6e26a-e2f5-5493-9f62-778a059815f4",
        "streamId": "st-3b258741-511d-564e-a4c8-b69a2d62d5ea",
        "dataSourceGroupId": "dsg-87aeed73-d39e-57b7-ad28-a5eb7e6aed0a",
        "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "createdOn": "2023-03-13T06:01:49.098Z",
        "lMod": "2023-03-13T06:01:49.000Z",
        "extractionType": "data",
        "extractionSourceId": "fs-47957dda-c46b-54ab-ac29-764fedc6f3a0",
        "_meta": {
            "state": "approved",
            "isDeleted": false,
            "updateAvailable": false,
            "contentSource": "manual"
        },
        "_source": {
            "sys_racl": [
                "*"
            ],
            "id": "1",
            "jobTitle": "Service Supervisor1",
            "emailAddress": "Gemma_Allen8451@sveldo.biz",
            "firstNameLastName": "Gemma Allen",
            "doc_id": "d-e66763e1-debf-51b6-945c-59df4724a7bd",
            "sys_content_type": "data",
            "sys_source_name": "Some Group Name"
        },
        "sourceHash": "eb8eb619e619970b65cb71c7450aa7b8",
        "__v": 0
    },
    {
        "_id": "fc-983074dd-9d92-533e-909f-bb309a3b1aab",
        "searchIndexId": "sidx-faf6e26a-e2f5-5493-9f62-778a059815f4",
        "streamId": "st-3b258741-511d-564e-a4c8-b69a2d62d5ea",
        "dataSourceGroupId": "dsg-87aeed73-d39e-57b7-ad28-a5eb7e6aed0a",
        "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
        "createdOn": "2023-03-13T06:01:49.098Z",
        "lMod": "2023-03-13T06:01:49.000Z",
        "extractionType": "data",
        "extractionSourceId": "fs-47957dda-c46b-54ab-ac29-764fedc6f3a0",
        "_meta": {
            "state": "approved",
            "isDeleted": false,
            "updateAvailable": false,
            "contentSource": "manual"
        },
        "_source": {
            "sys_racl": [
                "*"
            ],
            "id": "2",
            "jobTitle": "Service Supervisor2",
            "emailAddress": "Liv_Baker8412@jiman.org",
            "firstNameLastName": "Liv Baker",
            "doc_id": "d-51a2ba09-d422-5b6a-998a-0fd7c5226ffb",
            "sys_content_type": "data",
            "sys_source_name": "Some Group Name"
        },
        "sourceHash": "508dcf5c7576bca7720f81709f023a12",
        "__v": 0
    }
]

Sample Request(Single File):

{
  "documents": [
    {
      "fileId":"65c306c564e6d524e1544954"
    }
  ],
  "name": "Some Dir name"
}

Sample Request(Multiple Files):

{
  "documents": [
    {
      "fileId":"65c306c564e6d524e1544954"
    },
   {
      "fileId":"65c306c564e6d524e1544955"
    }
  ],
  "name": "Some Dir name"
}

Train API

Trains the SearchAssist application with all the ingested data or a specific data using the default Index and Search configuration.

  • Invoking Train API can be a costly operation since it processes all the available data. 
  • If index=true is sent as part of the Ingest API, then this API call is redundant. 
Method POST
Endpoint <host_url>/searchassistapi/external/stream/<enter-your-AppId-here>/train
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Train

Request Parameters

Parameters Description Mandatory
ContentIds List of one or more identifiers of the ingested content for which the application is to be trained. No, only used when the application needs to be trained for a specific set of data.

Sample Request( Train for a specific file)

{
  "contentIds": ["fc-8a634c5f-80e9-50aa-8e7c-a6914362d2be"]
}

Sample Response(All): 

{
    "hidden": false,
    "read": false,
    "status": "INPROGRESS",
    "percentageDone": 0,
    "timedOut": false,
    "_id": "fj-977caf7f-1663-5deb-a61c-b558b7011741",
    "createdOn": "2023-03-13T07:01:18.432Z",
    "jobType": "TRAINING",
    "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
    "title": "Training index 'Default Index'",
    "searchIndexId": "sidx-faf6e26a-e2f5-5493-9f62-778a059815f4",
    "streamId": "st-3b258741-511d-564e-a4c8-b69a2d62d5ea",
    "metadata": {
        "crawlerAck": false,
        "indexPipelineId": "fip-8a1ffeb2-1b9d-5b4e-b2a9-e415ad5968a8"
    },
    "startedAt": "2023-03-13T07:01:18.462Z",
    "lMod": "2023-03-13T07:01:18.462Z",
    "__v": 0
}

Add Index Fields

This API is used to create one or more index fields in the SearchAssist application. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization <JWT Token>
API Scope     Fields

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
indexPipelineId Provide the index configuration ID here. If this parameter is not passed, the index configuration marked as default in the application is used.  No
queryPipelineId Provide the search configuration ID here. If this parameter is not passed, the default search configuration in the application is used.  No

Request Parameters:

Parameters Description Mandatory
fields Array of field objects to be created in the application Each field object can have the following values:

“fieldName”: name for the field,

“fieldDataType”: data type of the field,

“isAutosuggest”: true/false,

“isSearchable”: true/false,

“weight”: the weightage to be assigned to this field during searches. This value can vary between 0 and 10. 

“presentable”: true/false

“highlight”: true/false

Note that only fieldName and fieldDataType are mandatory properties. The other properties are optional. When not provided, the field will have default values for these properties. 

Yes.

Sample Request

{
  "fields": [
    {
      "fieldName": "prod_category",
      "fieldDataType": "string",
      "isAutosuggest": true,
      "isSearchable": false,
      "weight": 8
    }
  ]
}

Sample Response:

 [{
    "_id": "fld-69121f6e-e225-59e5-acf9-db21307f0e7a",
    "searchIndexId": "sidx-1a03bc64-a17c-59f7-ba81-6a9be27a08db",
    "streamId": "st-bd0f08f4-56a9-542d-a7d0-ff57685664c9",
    "indexPipelineId": "fip-b59cf324-3504-5c8c-bc3d-94c93c70d3c5",
    "createdBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
    "lModifiedBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
    "createdOn": "2022-09-20T06:30:34.942Z",
    "lModifiedOn": "2022-09-20T06:30:34.000Z",
    "isSearchable": true,
    "isAutosuggest": true,
    "owner": "user",
    "fieldName": "Prod_category",
    "fieldDataType": "string",
    "presentable": true,
    "highlight": true,
    "weight": 8,
    "_v": 0
  }
]

Update Index Fields

This API is used to update the values for one or more index fields in the SearchAssist application. 

Method PUT
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

Parameters Description Mandatory
fields Array of field objects to be updated in the application. Each field object can have the following values:

“fieldId” : Unique identifier of the field. This is mandatory. 

“fieldName”: name for the field to be updated.

“fieldDataType”: data type of the field to be updated.

“isAutosuggest”: value to be updated. Set to true/false.

“isSearchable”: value to be updated.Set to true/false.

“weight”: value to be updated. Set to a value between 0 and 10. 

Yes.

Get Index Fields

This API is used to fetch the index fields from the SearchAssist application. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
indexPipelineId Unique identifier for the index configuration for which you want to fetch the indices.  No. When this field is not provided, the application will use default index configuration. 
skip This is the number of index records to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of index records to be fetched in each API call.  No. When not provided, the default value of 50 is used.

The parameters skip and limit are used to restrict the max number of index field records that are returned in a single call to this API. For example, if skip is set to 0 and limit is set to 10, the first 10 records are returned as response to the call. Similarly, if skip is set to 10 and limit is set to 5, 5 records starting from the 11th record are returned.   

Sample Response

"data": [
    {
      "_id": "fld-69121f6e-e225-59e5-acf9-db21307f0e7a",
      "searchIndexId": "sidx-1a03bc64-a17c-59f7-ba81-6a9be27a08db",
      "streamId": "st-bd0f08f4-56a9-542d-a7d0-ff57685664c9",
      "indexPipelineId": "fip-b59cf324-3504-5c8c-bc3d-94c93c70d3c5",
      "createdBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
      "lModifiedBy": "u-5ea99dbd-3779-58be-b8dd-9a58011a3989",
      "createdOn": "2022-09-20T06:30:34.942Z",
      "lModifiedOn": "2022-09-20T06:30:34.000Z",
      "isSearchable": true,
      "isAutosuggest": true,
      "owner": "user",
      "fieldName": "Prod_category",
      "fieldDataType": "string",
      "presentable": true,
      "highlight": true,
      "weight": 8,
      "_v": 0
    }
  ],
  "totalCount": 1,
  "hasMore": false
}

Delete Index Fields

This API is used to delete index fields from the SearchAssist application. 

Method DELETE
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
indexPipelineId Unique identifier for the index configuration for which you want to fetch the indices.  No. When this field is not provided,default index configuration is used. 
queryPipelineId Unique identifier for the search configuration. This will be used to delete the corresponding attributes from the search configuration. No. When not provided, default search configuration is used. 

Request Parameters

Parameters Description Mandatory
fieldIds Array of unique identifiers of the index fields to be deleted.  The index field identifiers begin with ‘fld’ and are returned as value of key ‘_id’ in response to get Index fields API.  Yes.

Edit Index Field by Id

This API is used to edit a specific index field in the SearchAssist application. 

Method PUT
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields/<fieldId>
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
fieldId Unique Identifier of the Index field to be updated. Yes

Request Parameters

Parameters Description Mandatory
fields Field object to be updated in the application. The field object should have the values to be updated in the application. You can update one or more of the following values of a field. 

“fieldName”: name for the field to be updated.

“fieldDataType”: data type of the field to be updated.

“isAutosuggest”: value to be updated. Set this to true/false.

“isSearchable”: value to be updated.Set this to true/false.

“weight”: value to be updated. Set this to a number between 0 and 10. Higher the number, more is the weightage of the field. 

“presentable”:  value to be updated.Set this to true/false.

“Highlight”:  value to be updated.Set this to  true/false.

Yes.

Get Index Field by Id

This API is used to fetch a specific index field from the SearchAssist application. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/fields/<fieldId>
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Fields

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
fieldId Unique Identifier of the Index field to be updated. Yes

Get Content

This API is used to fetch the content records from the SearchAssist application.  Currently, this API only supports structured data. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/content
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Content

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
skip Number of documents to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of records to be fetched as response to the API call, starting with a record after the skip count. No. When not provided, the default value of 50 is used.

The parameters skip and limit are used to restrict the max number of index records that are returned in a particular API call. For example, if skip is set to 0 and limit is set to 10, the first 10 records are returned as response to the call. If,  skip is set to 10 and limit is set to 5, 5 records starting from the 11th record are returned.  

Sample Response

{
    "data": [
        {
            "_id": "fc-e9749c38-3427-5a4e-96b9-f6898996dbcd",
            "searchIndexId": "sidx-3752fcd3-8572-5c91-a988-e6e1e6f89ab0",
            "extractionSourceId": "fs-5bb62969-6782-5c7c-aad6-95e64d18f839",
            "streamId": "st-abc4a25d-f740-578a-9cda-620e92575211",
            "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "createdOn": "2024-01-04T07:15:59.594Z",
            "lMod": "2024-01-04T07:15:59.000Z",
            "extractionType": "data",
            "_meta": {
                "state": "approved",
                "isDeleted": false,
                "updateAvailable": false,
                "fileName": "f-9aad1ef0-1d4f-591f-b2f7-2b0c3877c3cd",
                "contentSource": "file"
            },
            "_source": {
                "sys_racl": [
                    "*"
                ],
                "sno": "10",
                "product": "Xerox 198",
                "name": "Dorothy Badders",
                "value1": "678",
                "value2": "-226.36",
                "value3": "4.98",
                "value4": "8.33",
                "desc": "Nunavut",
                "type": "Paper",
                "quality": "0.38",
                "doc_id": "d-2a6a8845-f7da-5fd5-b356-aa7f62c56101",
                "sys_content_type": "data",
                "sys_source_name": "Default Structured Data File Source"
            },
            "dataSourceGroupId": "dsg-eb43977b-2769-5836-846b-b841c14fc2f2",
            "subscriptionId": "fsub-047387b0-199f-5d9b-8e51-d0474b14825f",
            "sourceHash": "4d3118b8248d17f8279f2b9c1b143bce",
            "__v": 0,
            "userDetails": {
                "fullName": "Documentation"
            },
            "modUserDetails": {
                "fullName": "Documentation"
            }
        },
        {
            "_id": "fc-75d9e059-7934-5578-b417-a84d7fbe4a07",
            "searchIndexId": "sidx-3752fcd3-8572-5c91-a988-e6e1e6f89ab0",
            "extractionSourceId": "fs-5bb62969-6782-5c7c-aad6-95e64d18f839",
            "streamId": "st-abc4a25d-f740-578a-9cda-620e92575211",
            "createdBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "lModBy": "u-efc256d6-9e11-5664-bcc2-384e20162550",
            "createdOn": "2024-01-04T07:15:59.593Z",
            "lMod": "2024-01-04T07:15:59.000Z",
            "extractionType": "data",
            "_meta": {
                "state": "approved",
                "isDeleted": false,
                "updateAvailable": false,
                "fileName": "f-9aad1ef0-1d4f-591f-b2f7-2b0c3877c3cd",
                "contentSource": "file"
            },
            "_source": {
                "sys_racl": [
                    "*"
                ],
                "sno": "8",
                "product": "SAFCO Mobile Desk Side File, Wire Frame",
                "name": "Carl Jackson",
                "value1": "613",
                "value2": "127.7",
                "value3": "42.76",
                "value4": "6.22",
                "desc": "Nunavut",
                "type": "Storage & Organization",
                "quality": "",
                "doc_id": "d-364e798b-228b-5fe5-8417-4e8784883b83",
                "sys_content_type": "data",
                "sys_source_name": "Default Structured Data File Source"
            },
            "dataSourceGroupId": "dsg-eb43977b-2769-5836-846b-b841c14fc2f2",
            "subscriptionId": "fsub-047387b0-199f-5d9b-8e51-d0474b14825f",
            "sourceHash": "f79acf3e664e7c18c8439886a62a01f2",
            "__v": 0,
            "userDetails": {
                "fullName": "Documentation"
            },
            "modUserDetails": {
                "fullName": "Documentation"
            }
        },
    ],
    "total": 2,
    "hasMore": false
}

Delete Content

This API is used to delete ingested content from the SearchAssist application.  Currently, this API supports structured data and files. Once the data is deleted from the application, it is no longer available for search. 

Method DELETE
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/content
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Content

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

 

Parameters Description Mandatory
docIDs Array of identifiers of the records to be deleted from the application. Please note that this id is available as doc_id and starts with “d-”.

Use this field for structured data.

No.
contentIds Array of file identifiers which are to be deleted from the application. Note that this id is presented as contentid and starts with ‘fc-”.

Use this for files.

No.

Sample Request(Structured Data)

{
  "docIds": [
    "d-2a6a8845-f7da-5fd5-b356-aa7f62c56101"
  ]
}

Sample Response(Structured Data)

{
    "n": 1,
    "ok": 1,
    "deletedCount": 1
}

Get Content by Condition

This API can be used to fetch specific content records from the SearchAssist application. The records to be fetched are specified using conditions in the request body. You can use any of the index fields for which the data is trained, to specify the condition. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/get-content-by-condition
Content Type application/json
Authorization auth: <JWT Token>
API Scope     Content

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
skip Number of documents to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of records to be fetched as response to the API call, starting with a record after the skip count. No. When not provided, the default value of 50 is used.

The parameters skip and limit are used to restrict the maximum number of records that are returned in an API call. For example, if the skip parameter is set to 0 and the limit is set to 10, the first 10 records are returned as the response to the call. If,  skip is set to 10 and the limit is set to 5, 5 records starting from the 11th record are returned.  

Request Parameters

Parameters Description Mandatory
query Array of conditions on the basis of which content is to be filtered. Yes.

Sample Request

To fetch all the web pages from the ingested content:

{
  "query": {
    "sys_content_type": "web"
  }
}

Import Index Configuration

This API can be used to import one or more index configurations to the SearchAssist application. 

 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/indexPipeline/import
Content Type application/json
Auth <JWT Token>
API Scope     App Settings

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Sample Request

{
    "appVersion": "1.1.0",
    "indexSettings": [
        {
            "name": "Default Index",
            "fields": [
                {
                    "isSearchable": true,
                    "isAutosuggest": false,
                    "owner": "user",
                    "fieldName": "faq_question_vector",
                    "fieldDataType": "dense_vector"
                },
               ...<more fields>,
           ],
            "settings": {
                "language": {
                    "enable": true,
                    "values": [
                        {
                            "language": "English",
                            "languageCode": "en",
                            "default": true
                        }
                    ]
                }
            },
            "stages": [
                {
                    "config": {
                        "mappings": [
                            {
                                "source_field": "faq_question",
                                "target_field": "faq_question_keywords",
                                "model": "topic_rank"
                            }
                        ]
                    },
                    "name": "FAQ Keyword Extraction",
                    "enable": true,
                    "type": "keyword_extraction",
                    "condition": {
                        "type": "basic",
                        "mappings": [
                            {
                                "value": [
                                    "faq"
                                ],
                                "operator": "equalsTo",
                                "fieldName": "sys_content_type"
                            }
                        ]
                    }
                },
                {
                    "config": {
                        "mappings": [
                            {
                                "source_field": "page_title",
                                "target_field": "page_title_keywords",
                                "model": "position_rank"
                            }
                        ]
                    },
                    "name": "Webdomain Keyword Extraction",
                    "enable": true,
                    "type": "keyword_extraction",
                    "condition": {
                        "type": "basic",
                        "mappings": [
                            {
                                "value": [
                                    "web"
                                ],
                                "operator": "equalsTo",
                                "fieldName": "sys_content_type"
                            }
                        ]
                    }
                },
                {
                    "config": {
                        "mappings": [
                            {
                                "source_field": "faq_question",
                                "target_field": "faq_question_vector",
                                "model": ""
                            },
                            {
                                "source_field": "page_title",
                                "target_field": "page_title_vector",
                                "model": ""
                            },
                            {
                                "source_field": "file_title",
                                "target_field": "file_title_vector",
                                "model": ""
                            }
                        ]
                    },
                    "name": "Default: Semantic Meaning",
                    "enable": true,
                    "type": "semantic_meaning",
                    "condition": {
                        "type": "basic",
                        "mappings": [
                            {
                                "value": [
                                    "faq",
                                    "web",
                                    "file"
                                ],
                                "operator": "contains",
                                "fieldName": "sys_content_type"
                            }
                        ]
                    }
                }
            ],
            "traits": [],
            "searchConfiguration": [
                {
                    "facets": [
                        {
                            "multiselect": false,
                            "active": true,
                            "showFieldWarning": false,
                            "type": "tab",
                            "tabs": [
                                {
                                    "fieldValue": "web",
                                    "bucketName": "Web Results"
                                },
                                {
                                    "fieldValue": "file",
                                    "bucketName": "Files"
                                },
                                {
                                    "fieldValue": "data",
                                    "bucketName": "Structured Data"
                                },
                                {
                                    "fieldValue": "faq",
                                    "bucketName": "FAQs"
                                }
                            ],
                            "name": "Default Tab Facet",
                            "fieldName": "sys_content_type"
                        }
                    ],
                    "fqpSettings": {
                        "name": "Default Search",
                        "default": true,
                        "facetOrder": [],
                        "settings": {
                            "weight": {
                                "enable": true,
                                "fieldValues": [
                                    "faq_question_vector",
                                    "page_preview",
                                    ...<more fields>,
                                    "page_title_keywords"
                                ]
                            },
                            "presentable": {
                                "enable": true,
                                "fieldValues": [
                                    "page_preview",
                                    "sys_source_name",
                                    "contentGroup",
                                    "file_title",
                                    "page_url",
                                    "doc_id",
                                    "page_image_url"
                                ]
                            },
                            "highlight": {
                                "highlightAppearance": {
                                    "preTag": "<span class=\"highlightText\">",
                                    "postTag": "</span>"
                                },
                                "enable": true,
                                "synonymsHighlight": true,
                                "fieldValues": [
                                    "page_preview",
                                    "faq_cond_answers",
                                    "faq_answer",
                                    "file_preview",
                                    "content"
                                ]
                            },
                            "spellCorrect": {
                                "enable": true,
                                "minCharThreshold": 4,
                                "maxTypoEdits": 2,
                                "fieldValues": [
                                    "page_preview",
                                    "page_body",
                                    "file_preview",
                                    "content",
                                    "title"
                                ]
                            },
                            "prefixSearch": {
                                "enable": false,
                                "type": "prefixAny",
                                "fieldValues": [
                                    "file_title",
                                    "title",
                                    "faq_question",
                                    "page_title"
                                ]
                            },
                            "searchRelevance": {
                                "enable": false,
                                "matchThreshold": 30,
                                "languages": [
                                    {
                                        "enable": false,
                                        "languageCode": "en",
                                        "verb": false,
                                        "subject": false,
                                        "object": false
                                    }
                                ]
                            },
                            "botActions": {
                                "enable": true,
                                "executeIntents": false
                            },
                            "stopwords": {
                                "enable": true,
                                "languageCodes": []
                            },
                            "synonyms": {
                                "enable": true,
                                "languageCodes": []
                            },
                            "smallTalk": {
                                "enable": true
                            },
                            "customConfiguration": {
                                "enable": true,
                                "values": []
                            }
                        }
                    },
                    "searchFields": [
                        {
                            "weight": {
                                "value": 2
                            },
                            "spellCorrect": {
                                "value": false
                            },
                            "presentable": {
                                "value": false
                            },
                            "highlight": {
                                "value": false
                            },
                            "prefixSearch": {
                                "value": false
                            },
                            "fieldName": "faq_question_vector"
                        },
                        ...<more searchable fields>,
                    ],
                    "synonyms": [],
                    "stopwords": [],
                    "answerSnippets": {
                        "config": [
                            {
                                "type": "extractive_model",
                                "active": false,
                                "similarityScore": 60,
                                "enabledFirstTime": true,
                                "workBenchStageFound": false,
                                "workBenchStageEnabled": false,
                                "searchFields": [
                                    {
                                        "fieldName": "snippet_title",
                                        "weight": 5
                                    },
                                    {
                                        "fieldName": "snippet_content",
                                        "weight": 3
                                    }
                                ]
                            },
                            {
                                "type": "generative_model",
                                "active": false,
                                "apiKeyRef": "",
                                "numberOfChunks": 5,
                                "temperature": 0.5,
                                "similarityScore": 40
                            }
                        ]
                    },
                    "prompts": [],
                    "entities": [
                        {
                            "entityType": "system_defined",
                            "entityName": "Date"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Time"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Location"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "GeoPoliticalEntities"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Company Name or Organization"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Currency"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Person Name"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Number"
                        },
                        {
                            "entityType": "system_defined",
                            "entityName": "Percentage"
                        }
                    ],
                    "rules": [],
                    "searchExperience": {
                        "searchInterface": {
                            "experienceConfig": {
                                "searchBarPosition": "bottom"
                            },
                            "widgetConfig": {
                                "searchBarFillColor": "#FFFFFF",
                                "searchBarBorderColor": "#E4E5E7",
                                "searchBarPlaceholderText": "Type here to search",
                                "searchBarPlaceholderTextColor": "#3C4043",
                                "searchButtonEnabled": false,
                                "buttonText": "BUTTON",
                                "buttonTextColor": "#BDC1C6",
                                "buttonFillColor": "#EFF0F1",
                                "buttonBorderColor": "#EFF0F1",
                                "userSelectedColors": [
                                    "#202124",
                                    "#7027E5",
                                    "#FFFFFF"
                                ],
                                "buttonPlacementPosition": "outside",
                                "searchBarIcon": ""
                            },
                            "interactionsConfig": {
                                "welcomeMsg": "Hi, How can I help you?",
                                "welcomeMsgColor": "#3C4043",
                                "showSearchesEnabled": true,
                                "showSearches": "frequent",
                                "autocompleteOpt": true,
                                "querySuggestionsLimit": 3,
                                "liveSearchResultsLimit": 0,
                                "feedbackExperience": {
                                    "queryLevel": false,
                                    "smartAnswer": false,
                                    "lmod": "2023-11-30T02:01:56.641Z"
                                },
                                "defaultStatus": "searchBar",
                                "welcomeMsgFillColor": "#EFF0F1"
                            }
                        },
                        "resultViewSettings": [
                            {
                                "facetsSetting": {
                                    "enabled": true,
                                    "aligned": "left"
                                },
                                "view": "fit",
                                "groupResults": true,
                                "interface": "liveSearch",
                                "groupSetting": {
                                    "conditions": [
                                        {
                                            "op": "equals",
                                            "fieldValue": "web",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Web Pages",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "page_title",
                                                    "description": "page_preview",
                                                    "img": "page_image_url",
                                                    "url": "page_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        }
                                    ],
                                    "fieldName": "sys_content_type"
                                },
                                "defaultTemplate": {
                                    "type": "list",
                                    "layout": {
                                        "renderTitle": false,
                                        "isClickable": false,
                                        "textAlignment": "left",
                                        "layoutType": "l3",
                                        "listType": "plain"
                                    },
                                    "mapping": {
                                        "heading": "",
                                        "description": "",
                                        "img": "",
                                        "url": "",
                                        "description1": "",
                                        "label1": "",
                                        "label2": "",
                                        "strikedOffRate": "",
                                        "rateField": "",
                                        "rating": "",
                                        "textField1": "",
                                        "textField2": "",
                                        "icon": "",
                                        "chips": ""
                                    }
                                }
                            },
                            {
                                "facetsSetting": {
                                    "enabled": true,
                                    "aligned": "left"
                                },
                                "view": "fit",
                                "groupResults": true,
                                "interface": "fullSearch",
                                "groupSetting": {
                                    "conditions": [
                                        {
                                            "op": "equals",
                                            "fieldValue": "web",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Web Pages",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "page_title",
                                                    "description": "page_preview",
                                                    "img": "page_image_url",
                                                    "url": "page_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        },
                                        {
                                            "op": "equals",
                                            "fieldValue": "faq",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": false,
                                                    "textAlignment": "left",
                                                    "layoutType": "l3",
                                                    "title": "FAQs",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "faq_question",
                                                    "description": "faq_answer",
                                                    "img": "",
                                                    "url": "",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        },
                                        {
                                            "op": "equals",
                                            "fieldValue": "file",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Files",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "file_title",
                                                    "description": "file_preview",
                                                    "img": "file_image_url",
                                                    "url": "file_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        }
                                    ],
                                    "fieldName": "sys_content_type"
                                },
                                "defaultTemplate": {
                                    "type": "list",
                                    "layout": {
                                        "renderTitle": false,
                                        "isClickable": false,
                                        "textAlignment": "left",
                                        "layoutType": "l3",
                                        "listType": "plain"
                                    },
                                    "mapping": {
                                        "heading": "",
                                        "description": "",
                                        "img": "",
                                        "url": "",
                                        "description1": "",
                                        "label1": "",
                                        "label2": "",
                                        "strikedOffRate": "",
                                        "rateField": "",
                                        "rating": "",
                                        "textField1": "",
                                        "textField2": "",
                                        "icon": "",
                                        "chips": ""
                                    }
                                }
                            },
                            {
                                "facetsSetting": {
                                    "enabled": true,
                                    "aligned": "left"
                                },
                                "view": "fit",
                                "groupResults": true,
                                "interface": "conversationalSearch",
                                "groupSetting": {
                                    "conditions": [
                                        {
                                            "op": "equals",
                                            "fieldValue": "web",
                                            "template": {
                                                "type": "list",
                                                "layout": {
                                                    "renderTitle": true,
                                                    "isClickable": true,
                                                    "textAlignment": "left",
                                                    "layoutType": "l4",
                                                    "title": "Web Pages",
                                                    "behaviour": "webpage",
                                                    "listType": "classic"
                                                },
                                                "mapping": {
                                                    "heading": "page_title",
                                                    "description": "page_preview",
                                                    "img": "page_image_url",
                                                    "url": "page_url",
                                                    "description1": "",
                                                    "label1": "",
                                                    "label2": "",
                                                    "strikedOffRate": "",
                                                    "rateField": "",
                                                    "rating": "",
                                                    "textField1": "",
                                                    "textField2": "",
                                                    "icon": "",
                                                    "chips": ""
                                                }
                                            }
                                        }
                                    ],
                                    "fieldName": "sys_content_type"
                                },
                                "defaultTemplate": {
                                    "type": "list",
                                    "layout": {
                                        "renderTitle": false,
                                        "isClickable": false,
                                        "textAlignment": "left",
                                        "layoutType": "l3",
                                        "listType": "plain"
                                    },
                                    "mapping": {
                                        "heading": "",
                                        "description": "",
                                        "img": "",
                                        "url": "",
                                        "description1": "",
                                        "label1": "",
                                        "label2": "",
                                        "strikedOffRate": "",
                                        "rateField": "",
                                        "rating": "",
                                        "textField1": "",
                                        "textField2": "",
                                        "icon": "",
                                        "chips": ""
                                    }
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ]
}

Export Index Configuration

This API can be used to export all the index configurations present in the SearchAssist application. The index configurations are provided as an array of JSON objects. 

Method GET
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/indexPipeline/export
Content Type application/json
Auth <JWT Token>
API Scope  App Settings

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
skip Number of documents to skip while fetching the records.  No. When not provided, the default value of 0 is used. 
limit This is the number of records to be fetched as response to the API call, starting with a record after the skip count. No. When not provided, the default value of 50 is used.

History

This API can be used to fetch the logs corresponding to a user’s interaction with the SearchAssist application. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/history
Content-Type application/json
Auth <JWT Token>
API Scope     Analytics

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

Parameters Description Mandatory
clientId Unique client Id for the application Yes
userIdentity Unique user Id for the user whose history is to be fetched.  Yes

Sample Request

{
  "userConfig": {
    "clientId": "cs-***",
    "userIdentity": "u-4e0c8e48-0126-51bb-bb74-********"
  }
}

UploadFile

This API can be used to upload a file to a server. Note that to ingest this file in the SearchAssist application, use the ingest API. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/uploadfile
Content-Type multipart/form-data
Auth <JWT Token>
API Scope     Ingest Data

Query Parameters

Parameters Description Mandatory
streamId Provide your application ID here.  Yes

Request Parameters

Parameters Description Mandatory
file File in Binary format  Yes
fileExtension The extension of the file (must be string) No
fileContext The location where the file is to be saved on the application. Currently, it only supports the default location. Set this field to ‘findly’. Yes
filename Name of the file as it is to be saved on the application. No
Content-Type Content type No

Sample Response

On successful file upload, the response provides the fileId. This fileId can be used to invoke ingest API if the file needs to be ingested into the SearchAssist application.  

{
    "fileId": "65c306c564e6d524e1544954",
    "hash": "c0ebc08aeae58a1bfdd036b501eef8f732bb2867"
}

Incremental Web Crawling

This API can be used to add a crawl and index a web page to a given web source without making changes to the existing configuration or recrawling the existing pages. If the web page that is passed as input to the API already exists in the web source, it is recrawled. Else, it is added as a new page to the source.

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/ingest?streamId=<streamId>&contentSource=<content-source-value>&extractionType=<extraction-type-value>&index=<index-value>
Content-Type application/json
Authorization auth: <JWT Token>
API Scope     Ingest Data

Query Parameters:

Parameters Description Mandatory
streamId Provide your application ID here.  Yes
contentSource Source of the data. Set this to ‘manual’. Yes
extractionType Type of data expected in the request body. Set this to ‘web’. Yes
index This parameter tells the application to train the application for the ingested web page. If this field is set to true, the SearchAssist application is trained with the ingested data immediately.  Note that the training is done using the default Index and Search Configurations set at the time of invoking the API.  When set to false, you have to run the training operation separately.  Yes

Request Parameters

Parameters Description Mandatory
name Name of the web source to which the web page is to be added.   Yes
documents Array of objects containing the URL of the web pages. Refer to the below sample request for format.   Yes 

Sample Request:

    {
        “documents”: [
            {
                “url”: https://kore.ai/itassist/”]
            }
        ],
        “name”:“kore”
    }
    

Response:

On successful crawling of the web page, you can see the indexed content from the page in the response. 

Points to Note:

  • When a new page is added to the web source through this API, performing a manual recrawl through the application or using the scheduler could result in the deletion of the page from the index, depending on the configuration of web source. If the page URL is also added to the web source’s sitemap, it will be created. Else, it will not be recrawled.  

For example, 

Scenario 1: Assume we add a new page, such as “https://kore.ai/searchassist,” to an existing web source named “kore” using this API. In the initial crawler run, if the page was not crawled because max url limit which was set to 10, was reached, it is highly probable that it will be skipped in the subsequent run as well. Hence, when you manually recrawl the web source, the new page will be deleted. 

Scenario 2: Assume an existing crawl configuration for the same web source has  depth=0 and maxurl=0, which implies that it should crawl the entire sitemap. In this case, if the web source is manually crawled again, the new page will be recrawled, given that it is part of the sitemap. 

  • You can add only one web page at a time using this incremental web crawl. 
  • If the name of the source does not match any of the existing source names in the application, the API will throw an error. 
  • The crawl configuration options set for the web source do not apply to the newly added web page. 

Fetch Debug Information 

This API is used to retrieve debug information corresponding to the answers and search results returned in response of the previous fullsearch or advancedSearch request.  In other words, invoke the search API to get your answers and then follow up with the answer-debug API to get the corresponding debug information. 

The API returns information about both answers and search results. Corresponding to the answers, it returns information like  the type of model used for answer generation, the retrieved and the qualified chunks for each model, the LLM properties and the LLM response in case of generative answers, and other important debug parameters. Corresponding to the search results, it returns information like search scores for the search results, config details, etc. 

It’s important to note that the time gap between the search API call and the answer debug API call must not exceed 600 seconds.

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/debug-answer
Content-Type application/json
Authorization auth: <JWT Token>
API Scope   Full Search

Request Parameters

Parameters Description Mandatory
queryPipelineId Search configuration Id. This is available as ‘queryPipelineId’ in the response of the search API invoked.  Yes
searchRequestId This field is available as ‘requestId’ in the response of the search API invoked.  Yes 

Sample Request:

{
  “queryPipelineId”: “fqp-b440ff10-365e-5c58-a4e8-650ce9ee6ab6”,
  “searchRequestId”: “fsh-d5460843-ff20-50f8-a70b-bd3f5083d6f2”
}

Feedback API

This API is used to update user feedback to an answer in the SearchAssist application. 

Method POST
Endpoint <host_url>/searchassistapi/external/stream/<streamId>/feedback
Content-Type application/json
Authorization auth: <JWT Token>
API Scope Analytics

 Query Parameters:

streamID: Provide your application ID here. 

Request Parameters:

Parameters Description Mandatory
feedback This field describes the type of results for which the feedback is being provided. It can take the following values: 1 for search results and 2 for answer Yes
type This field is the actual feedback for the answer or search result. It can take the following values:
1 for positive feedback or thumbsUp and 2 for negative feedback or thumbsDown.
Yes 
searchRequestId This field is available as ‘requestId’ in the response of the search API invoked.   Yes
Comments This field can be used to pass additional comments along with the feedback. It is in JSON format as shown in the example below, 

“comments”: {

    “text”: “comment “,

    “issueType”: “incorrect”

  }

Here, the ‘text’ field contains the comment text to append to the feedback, while issueType may be one of the following options: incorrect, outdated, few_results, or other.

No

Sample Request 

{
  "feedback": 1,
  "type": 1,
  "searchRequestId": "search requestId",
  "comments": {
    "text": "comment ",
    "issueType": "incorrect"
  }
}