This document explains how to connect a data source to Miao-Search via API.
Overview
- If you have a proprietary search service with an API, you can integrate it with Miao-Search as a custom data source.
- By combining your third-party search API with the Miao-Search large model, you can deliver intelligent, generative search results.
- Miao-Search currently supports API definitions in JSON format.
Configuration
Configuration example
Request configuration: searchSourceRequestConfig
-
URL (
url) The URL of your API endpoint. The endpoint must be publicly accessible, such ashttp://xxxx. -
Request header (
headers) You can add request headers, such asContent-Typeand authentication information. -
HTTP method (
method): The HTTP method for the request. Supported methods areGETandPOST. -
Connection timeout (
connectTimeout) The connection timeout in milliseconds. A value of 6000 or less is recommended. -
Request timeout (
socketTimeout) The request timeout in milliseconds. A value of 6000 or less is recommended. -
Enable path parameters (
pathParamsEnable) Specifies whether to send parameters in the URL path. The default value isfalse, which sends parameters in the JSON request body. If set totrue, parameters are sent in the URL path. -
Request parameters (
params) Defines the parameters to build the API request.Parameter
Description
name
The name of the request parameter.
value
The value of the parameter. This can be a fixed value or a variable in the format ${variableName}. The following built-in variables are supported:
query: The search query.
current: The current page number.
size: The page size.
includeContent: Whether to include the document content. It is recommended that your API support returning the content, which can be returned by default.
startTime: The start time.
endTime: The end time.
valueType
The field type of the parameter, used for format conversion. Default: string. Supported types include:
string
number
boolean
time
valueFormat
Valid when valueType is time. Supported time formats include:
yyyy-MM-dd
yyyy-MM-dd HH:mm:ss
longTime
longTimeMillis
-
Request body (
body) The content of the request body. You can reference variables by using the${variableName}syntax. Variables can be built-in or defined inparams.
Response parsing configuration: searchSourceResponseConfig
Response parsing transforms the raw response from your API into the following standard response format.
jqNodes
This object defines the parsing configuration and supports up to three levels of nesting.
Field | Description |
|---|---|
path | The JSON path, for example, total. |
type | The data type. Supported types include:
|
key | The name of the field mapped to in the standard response. |
jqNodes | Child node definitions. |
FAQ
Q: Does Miao-Search support passing custom identity parameters in HTTP headers?
A:
Yes. You can directly add custom key-value fields to the request header (Headers). These fields are at the same level as standard fields such as Content-Type, and the server will automatically parse and identify your system identity.