# SemanticSearch

Defines a semantic search operation.

| JSON representation |
|---|
| ``` { "searchText": string, "searchField": string, "taskType": enum (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections#EmbeddingTaskType`), "outputFields": { object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/OutputFields`) }, "filter": { object }, "searchHint": { object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/SearchHint`) }, "topK": integer } ``` |

| Fields ||
|---|---|
| `searchText` | `string` Required. The query text, which is used to generate an embedding according to the embedding model specified in the collection config. |
| `searchField` | `string` Required. The vector field to search. |
| `taskType` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections#EmbeddingTaskType`)`` Required. The task type of the query embedding. |
| `outputFields` | ``object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/OutputFields`)`` Optional. The fields to return in the search results. |
| `filter` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}}, represented as a google.protobuf.Struct. |
| `searchHint` | ``object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/SearchHint`)`` Optional. Sets the search hint. If no strategy is specified, the service will use an index if one is available, and fall back to KNN search otherwise. |
| `topK` | `integer` Optional. The number of data objects to return. |