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+YNun4Hi3M9bk0YE3bVEX1pQhpS0U4HIRfselIB1wqKwsuV3DI64TkD6iIsNb3VhBEeosI0Ysuspoh1BrgRbm/Wb7/SOu5wlo42Hep+Pm/eBsg4J9JLNdiLpWirLzvaEeoMqbFs+Lg44IIX40GpP2Pc+tcQ64UrvdffiHscCXXCqeqb3VBGqHIcy5ks7ft8/n4I1RAaCoXW0R5jnXDd7uhcnrErV3b996W2MMXMlS+m7UUnt8QNuJ+zC6j3WZoQWzgJ29biWNBeR50brKElZKLcu6ZOlgm0SkPUvhsQzSyk729ocd5pFiWBVosRvDzuzxEN5puP79Ayyk8mihsiiogZBOo25ah7SX3Kfw6o9f3396D/Nwwn1utJi/6rMtBSK9wl2XfmoamTv8J/XgNnnecIfN9YjrlbHifwLcdrt9FtOvNzdXO66I/U9t45B4w2NssXeX7RKXgDPgC+6h9QRyriFDcDUxCgrgjvjPVE3bLiQqEbIfzsq5Uq5/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3ExqytYikrvK/SkxNlcq4K43w6HVwMnrHOB3oNApeoTEXXhcaVPvxi9EI+0JUofAyY93pkke5Ad3RcXofLBJ3HKxnRNLujd5SGT/t7+vt9Bo6PcQ153nXvlOyzftRmpYGUJ4WgUEmY8neT3mA3Su7kt50edw/2o+DXDW4TJvXCRFhHCrS1JoQfp+hK5ihgv0TJHIko0w0jsafRpOJ5gb1Rn9LdSI9Ee/hmmzAqWDQ87F/0R0FgjfMl1x1j122FD1zZ7DH4/69IR78iNfJLR55UistwRQmdsWkaaMaWw9A5IcF3CaMuocebDcX02artlh5H1U1ndwlbcivpu0KAesIK5ILqOgu3U5ayX2JRemFeouWqxsjAhyRBpB53vMtzrPyLa+86DHD12/UNS1jWfP+ioAmvfEXjNl+xlIUPaLQ7yEV4tmGK64c6yka0SX//BdX+MHw=
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\n returned 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/sYenja2OHW8jVLmPRYdp87b6V+YNun4Hi3M9b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6s4QtgkKylAlTZwqP1rMzgTeYiQjxJvyggXt9IKahOs8Hqg/SebLQ4iPI1opQF3D2JGR3VJ8jIz4h9h0LzDZdpDb8zlJ2CZkxjyjCvOVIelrq7XbOoSg8q62kwf9sISZ8NJz0BtPpsDceDUWP5zjoZaOL02x6Op6MsklrNOR7pwbp8Hw0Ph+eTcajfUEG/YshqQnh/qjnQlrMwwD1kQYA/sMOT/loMrmYLHoXF4usNx4Pxr1pPh31cDgYn4npYpyPsxcdnkynw67D09PRC/7+B10CK3xlCTZxcPDmAX2B9sddH4+GKKbjXjY9E71xNhz0srHgvXM+Ph3h9GI4ygcv53o4Ou26fj49P5uEdN8dilk6Hm2DBo+PqeylXnIlxc9d4Q4Ri9YaS1O4iTLhTG1zdFBZs5QCBYvuTI6749GSwDi0S7QQbf2sJ581fqkwJ1mSxw4Ak+e1tY1rkVIL096FqYLcFyxlJ8vhye5iHA3ExqytYikrvK/SkxNlcq4K43w6HVwMnrHOB3oNApeoTEXXhcaVPvxi9EI+0JUofAyY93pkke5Ad3RcXofLBJ3HKxnRNLujd5SGT/t7+vt9Bo6PcQ153nXvlOyzftRmpYGUJ4WgUEmY8neT3mA3Su7kt50edw/2o+DXDW4TJvXCRFhHCrS1JoQfp+hK5ihgv0TJHIko0w0jsafRpOJ5gb1Rn9LdSI9Ee/hmmzAqWDQ87F/0R0FgjfMl1x1j122FD1zZ7DH4/69IR78iNfJLR55UistwRQmdsWkaaMaWw9A5IcF3CaMuocebDcX02artlh5H1U1ndwlbcivpu0KAesIK5ILqOgu3U5ayX2JRemFeouWqxsjAhyRBpB53vMtzrPyLa+86DHD12/UNS1jWfP+ioAmvfEXjNl+xlIUPaLQ7yEV4tmGK64c6yka0SX//BdX+MHw=
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\n returned 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