1---
2id: post-search
3title: "Search"
4description: "Perform a vector similarity search (VSS) operation on a dataset."
5sidebar_label: "Search"
6hide_title: true
7hide_table_of_contents: true
8api: eJztWN9v2zgS/lcGvIe2gOzYjp04AvrQW/SwOfS62Sa9xcEJYkocR9xQpJak7BqG//fDkJItJ27aXl8vL4Elcjg/vvm+oTbM8wfH0hm7/v0Du0uYQJdbWXlpNEvZFdqFsSVwWGLujQUnS6m4lX4NDrnNC3j97+vrN2AqtJw2gdHAQXDPHfr+rb7VNwW2a/erVlIpsOhrq8EXCKVxHiwqXHLtoeQ+L9BBxh0KspgbJzV2T19JX4SdUle1h7nHL37ej6c1pzv4q0Yr0YErTK0EFHyJwDVgmaEQUj9AblRd6gS4FsEYryprKiu5x86q0ghUoAwXKPosYbswLgVLWWWcv48BsoRZ/KtG5/9uxJqlmyfpvI5paNZAxS0v0aN1LGG50R61p028qpTMwwknfzrauWEuL7Dk4a1Svy1YOtswv66Qpcxkf2Lum7OlRUHlpHxQPSketF6iC3uFkGSWq/sYenja2OHW8jVLmPRYdp87b6V+YNun4Hi3M9bk0YE3bVEX1pQhpS0U4HIRfselIB1wqKwsuV3DI64TkD6iIsNbHY2gCGWWESIWXWW0Q6i1QAvzfrP7/hHX8wS08TDv02nzfvC1AcE+kNkuQl0rRcn53kgPQOVNC+fFQUOECD8ajUn7nufWOAdcqd3uPvzDWOBLLhXP1N5qArXDEOZcSefv2+dz8MaogE/UrrYI85zrBm73wuR1idq7t2+9rTEGrmQpfTdqqT0+oO3EfRjdx7rM0IJZwM5et5DGAvK8aF1lCSullmVdsnSwTSLQnqXwWAZpZSd7+8MO80gxrAq02I1hZ/Z4CO80XP/+ARZSebRQWRTUP0inUTOtQ9pL7lN49cev7z+9h3k44T43Wsxf9dmWApFe4a5JPzV9zB3+k1pwmzzvt8PeesT1yljxPwFuu90+i+nXm5urHVXE9qeucUi04TF22LvLdolLwBnwBffQegI515AhuJoIBQVwR/RnqqZrFxKVCNkPZ+VcKde/1fN4mHVzEA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ZWsZQV3lfpyYkyOVeFcT6dDi4Gz1jnA70GgUtUpqLrQuNKH34xeiEf6EoUvgXMez2ySHegOzour8Nlgs7jlYxomt3RO0rDp/01/f0+A8fHuIY877p3SvZZP2qz0kDKk0JQqCRM+btJb7AbJXfy206Puwf7UfDrBrcJk3phIqwjBdpaE8KPU3QlcxSwX6JkjkSU6YaR2NNoUvG8wN6oT+lupEeiPXyzTRgVLBoe9s/6g16tnadba1Ba43zJdcfqdVvqA582ezD+/2vS0a9JjQ7TkSeV4jLcVUKLbJpOmrHlMLRQSPBdwqhd6PFmQzF9tmq7pcdRftPZXcKW3MpQKsJ8wgrkggo8C9dUlrJfYlF6YXCi5arGSMWHbEHsHne8y3Os/Itr7zpUcPXb9Q1LWNZ8B6OgCbh8RXM3X7GUhQ9ptDvoRni2YYrrhzrqR7RJf/8FVQgz4g==
9sidebar_class_name: "post api-method"
10info_path: docs/api/HTTP/runtime
11custom_edit_url: null
12proxy: http://localhost:8090
13---
14
15import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
16import ParamsDetails from "@theme/ParamsDetails";
17import RequestSchema from "@theme/RequestSchema";
18import StatusCodes from "@theme/StatusCodes";
19import OperationTabs from "@theme/OperationTabs";
20import TabItem from "@theme/TabItem";
21import Heading from "@theme/Heading";
22
23<Heading
24 as={"h1"}
25 className={"openapi__heading"}
26 children={"Search"}
27>
28</Heading>
29
30<MethodEndpoint
31 method={"post"}
32 path={"/v1/search"}
33 context={"endpoint"}
34>
35
36</MethodEndpoint>
37
38
39
40Perform a vector similarity search (VSS) operation on a dataset.
41
42The search operation will return the most relevant matches based on cosine similarity with the input `text`.
43The datasets queries should have an embedding column, and the appropriate embedding model loaded.
44
45<Heading
46 id={"request"}
47 as={"h2"}
48 className={"openapi-tabs__heading"}
49 children={"Request"}
50>
51</Heading>
52
53<ParamsDetails
54 parameters={undefined}
55>
56
57</ParamsDetails>
58
59<RequestSchema
60 title={"Body"}
61 body={{"description":"Search request parameters","content":{"application/json":{"schema":{"allOf":[{"type":"object","required":["text"],"properties":{"additional_columns":{"type":"array","items":{"type":"string"},"description":"Additional columns to return from the dataset. If the column is a primary key, it will be\nreturned within the response under `.primary_key`, not `.data`."},"datasets":{"type":["array","null"],"items":{"type":"string"},"description":"The datasets to search for similarity. If None, search across all datasets. For available datasets, use the `list_datasets` tool and ensure `can_search_documents==true`."},"limit":{"type":["integer","null"],"description":"Number of documents to return for each dataset","minimum":0},"text":{"type":"string","description":"The text to search documents for similarity"},"where":{"type":["string","null"],"description":"An SQL filter predicate to apply. Format: 'WHERE `where_cond`'."}},"title":"SearchRequestBaseJson"},{"type":"object","properties":{"keywords":{"type":["array","null"],"items":{"type":"string"}}}}],"description":"HTTP request schema is separate from AI requests, so that keywords can be supplied as an optional field for HTTP calls.\n`schemars` doesn't allow setting `#[serde(default)]` as well as `#[schemars(required)]` - the field does not become required.\nWhen the field is not required, the model ignores it.","title":"SearchRequestHTTPJson"},"example":{"datasets":["app_messages"],"text":"Tokyo plane tickets","where":"user=1234321","additional_columns":["timestamp"],"limit":3,"keywords":["plane","tickets"]}}},"required":true}}
62>
63
64</RequestSchema>
65
66<StatusCodes
67 id={undefined}
68 label={undefined}
69 responses={{"200":{"description":"Search completed successfully","content":{"application/json":{"schema":{"type":"object","required":["results","duration_ms"],"properties":{"duration_ms":{"type":"integer","description":"Total time taken to execute the search, in milliseconds","minimum":0},"results":{"type":"array","items":{"type":"object","required":["matches","score","dataset"],"properties":{"data":{"type":"object","description":"Addditional data from the `dataset` requested by the user.","additionalProperties":{},"propertyNames":{"type":"string"}},"dataset":{"type":"string","description":"The name of the dataset where the match was found"},"matches":{"type":"object","description":"The matches for this result","additionalProperties":{"oneOf":[{},{"type":"array","items":{}}],"title":"MatchType"},"propertyNames":{"type":"string"}},"metadata":{"type":"object","additionalProperties":{},"propertyNames":{"type":"string"}},"primary_key":{"type":"object","description":"Primary key(s) identifying the matched item in the dataset","additionalProperties":{},"propertyNames":{"type":"string"}},"score":{"type":"number","format":"double","description":"The similarity of the match to the query"}},"title":"Match"},"description":"List of matches that were found in the datasets"}},"title":"SearchResponse"},"example":{"results":[{"matches":{"message":"I booked use some tickets"},"dataset":"app_messages","primary_key":{"id":"6fd5a215-0881-421d-ace0-b293b83452b5"},"data":{"timestamp":1724716542},"score":0.914321},{"matches":{"message":"direct to Narata"},"dataset":"app_messages","primary_key":{"id":"8a25595f-99fb-4404-8c82-e1046d8f4c4b"},"data":{"timestamp":1724715881},"score":0.83221},{"matches":{"message":"Yes, we're sitting together"},"dataset":"app_messages","primary_key":{"id":"8421ed84-b86d-4b10-b4da-7a432e8912c0"},"data":{"timestamp":1724716123},"score":0.787654321}],"duration_ms":42}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{},"example":{"error":"No data sources provided"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{},"example":{"error":"Unexpected internal server error occurred"}}}}}}
70>
71
72</StatusCodes>
73
74
75
1---
2id: post-search
3title: "Search"
4description: "Perform a vector similarity search (VSS) operation on a dataset."
5sidebar_label: "Search"
6hide_title: true
7hide_table_of_contents: true
8api: eJztWN9v2zgS/lcGvIe2gOzYjp04AvrQW/SwOfS62Sa9xcEJYkocR9xQpJak7BqG//fDkJItJ27aXl8vL4Elcjg/vvm+oTbM8wfH0hm7/v0Du0uYQJdbWXlpNEvZFdqFsSVwWGLujQUnS6m4lX4NDrnNC3j97+vrN2AqtJw2gdHAQXDPHfr+rb7VNwW2a/erVlIpsOhrq8EXCKVxHiwqXHLtoeQ+L9BBxh0KspgbJzV2T19JX4SdUle1h7nHL37ej6c1pzv4q0Yr0YErTK0EFHyJwDVgmaEQUj9AblRd6gS4FsEYryprKiu5x86q0ghUoAwXKPosYbswLgVLWWWcv48BsoRZ/KtG5/9uxJqlmyfpvI5paNZAxS0v0aN1LGG50R61p028qpTMwwknfzrauWEuL7Dk4a1Svy1YOtswv66Qpcxkf2Lum7OlRUHlpHxQPSketF6iC3uFkGSWq/sYenja2OHW8jVLmPRYdp87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zP/7PX3p9yM8N6/0kH9WcIWQSFZyoSpM4VH69kZwBvMRIR4E37QvL0+ENNQnecD1QfpPFlo8RFka0WoCzh7ErI7qs+REZ8Q+44FZpsuUht+Zym7hMyYRxRh3nIkPS31djvnUBSe1VbS3H+2EBM+Gk56g+l02BuPhqLHcxz0stHFaTY9HU9G2aQ1GvK9U4N0eD4anw/PJuPRviCD/sWQ1IRwf9RzIS3mYYD6SAMA/2GHp3w0mVxMFr2Li0XWG48H4940n456OByMz8R0Mc7H2YsOT6bTYdfh6enoBX//gy6BFb6yBJs4OHjzgL5A++Ouj0dDFNNxL5ueid44Gw562Vjw3jkfn45wejEc5YOXcz0cnXZdP5+en01Cuu8OxSwdj7ZBg8fHVPZSL7mS4uducIeIRWuNpSncRJlwprY5OqisWUqBgkV3Jsfd8WhJYBzaJVqItn7Wk88av1SYkyzJYweAyfPa2sa1SKmFaa/CVEHuC5ayk+XwZHcvjgZiY9ZWsZQV3lfpyYkyOVeFcT6dDi4Gz1jnA70GgUtUpqLrQuNKH34xeiEf6EoUvgXMez2ySHegOzour8Nlgs7jlYxomt3RO0rDp/01/f0+A8fHuIY877p3SvZZP2qz0kDKk0JQqCRM+btJb7AbJXfy206Puwf7UfDrBrcJk3phIqwjBdpaE8KPU3QlcxSwX6JkjkSU6YaR2NNoUvG8wN6oT+lupEeiPXyzTRgVLBoe9s/6g16tnadba1Ba43zJdcfqdVvqA582ezD+/2vS0a9JjQ7TkSeV4jLcVUKLbJpOmrHlMLRQSPBdwqhd6PFmQzF9tmq7pcdRftPZXcKW3MpQKsJ8wgrkggo8C9dUlrJfYlF6YXCi5arGSMWHbEHsHne8y3Os/Itr7zpUcPXb9Q1LWNZ8B6OgCbh8RXM3X7GUhQ9ptDvoRni2YYrrhzrqR7RJf/8FVQgz4g==
9sidebar_class_name: "post api-method"
10info_path: docs/api/HTTP/runtime
11custom_edit_url: null
12proxy: http://localhost:8090
13---
14
15import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
16import ParamsDetails from "@theme/ParamsDetails";
17import RequestSchema from "@theme/RequestSchema";
18import StatusCodes from "@theme/StatusCodes";
19import OperationTabs from "@theme/OperationTabs";
20import TabItem from "@theme/TabItem";
21import Heading from "@theme/Heading";
22
23<Heading
24 as={"h1"}
25 className={"openapi__heading"}
26 children={"Search"}
27>
28</Heading>
29
30<MethodEndpoint
31 method={"post"}
32 path={"/v1/search"}
33 context={"endpoint"}
34>
35
36</MethodEndpoint>
37
38
39
40Perform a vector similarity search (VSS) operation on a dataset.
41
42The search operation will return the most relevant matches based on cosine similarity with the input `text`.
43The datasets queries should have an embedding column, and the appropriate embedding model loaded.
44
45<Heading
46 id={"request"}
47 as={"h2"}
48 className={"openapi-tabs__heading"}
49 children={"Request"}
50>
51</Heading>
52
53<ParamsDetails
54 parameters={undefined}
55>
56
57</ParamsDetails>
58
59<RequestSchema
60 title={"Body"}
61 body={{"description":"Search request parameters","content":{"application/json":{"schema":{"allOf":[{"type":"object","required":["text"],"properties":{"additional_columns":{"type":"array","items":{"type":"string"},"description":"Additional columns to return from the dataset. If the column is a primary key, it will be\nreturned within the response under `.primary_key`, not `.data`."},"datasets":{"type":["array","null"],"items":{"type":"string"},"description":"The datasets to search for similarity. If None, search across all datasets. For available datasets, use the `list_datasets` tool and ensure `can_search_documents==true`."},"limit":{"type":["integer","null"],"description":"Number of documents to return for each dataset","minimum":0},"text":{"type":"string","description":"The text to search documents for similarity"},"where":{"type":["string","null"],"description":"An SQL filter predicate to apply. Format: 'WHERE `where_cond`'."}},"title":"SearchRequestBaseJson"},{"type":"object","properties":{"keywords":{"type":["array","null"],"items":{"type":"string"}}}}],"description":"HTTP request schema is separate from AI requests, so that keywords can be supplied as an optional field for HTTP calls.\n`schemars` doesn't allow setting `#[serde(default)]` as well as `#[schemars(required)]` - the field does not become required.\nWhen the field is not required, the model ignores it.","title":"SearchRequestHTTPJson"},"example":{"datasets":["app_messages"],"text":"Tokyo plane tickets","where":"user=1234321","additional_columns":["timestamp"],"limit":3,"keywords":["plane","tickets"]}}},"required":true}}
62>
63
64</RequestSchema>
65
66<StatusCodes
67 id={undefined}
68 label={undefined}
69 responses={{"200":{"description":"Search completed successfully","content":{"application/json":{"schema":{"type":"object","required":["results","duration_ms"],"properties":{"duration_ms":{"type":"integer","description":"Total time taken to execute the search, in milliseconds","minimum":0},"results":{"type":"array","items":{"type":"object","required":["matches","score","dataset"],"properties":{"data":{"type":"object","description":"Addditional data from the `dataset` requested by the user.","additionalProperties":{},"propertyNames":{"type":"string"}},"dataset":{"type":"string","description":"The name of the dataset where the match was found"},"matches":{"type":"object","description":"The matches for this result","additionalProperties":{"oneOf":[{},{"type":"array","items":{}}],"title":"MatchType"},"propertyNames":{"type":"string"}},"metadata":{"type":"object","additionalProperties":{},"propertyNames":{"type":"string"}},"primary_key":{"type":"object","description":"Primary key(s) identifying the matched item in the dataset","additionalProperties":{},"propertyNames":{"type":"string"}},"score":{"type":"number","format":"double","description":"The similarity of the match to the query"}},"title":"Match"},"description":"List of matches that were found in the datasets"}},"title":"SearchResponse"},"example":{"results":[{"matches":{"message":"I booked use some tickets"},"dataset":"app_messages","primary_key":{"id":"6fd5a215-0881-421d-ace0-b293b83452b5"},"data":{"timestamp":1724716542},"score":0.914321},{"matches":{"message":"direct to Narata"},"dataset":"app_messages","primary_key":{"id":"8a25595f-99fb-4404-8c82-e1046d8f4c4b"},"data":{"timestamp":1724715881},"score":0.83221},{"matches":{"message":"Yes, we're sitting together"},"dataset":"app_messages","primary_key":{"id":"8421ed84-b86d-4b10-b4da-7a432e8912c0"},"data":{"timestamp":1724716123},"score":0.787654321}],"duration_ms":42}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{},"example":{"error":"No data sources provided"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{},"example":{"error":"Unexpected internal server error occurred"}}}}}}
70>
71
72</StatusCodes>
73
74
75