# text_search

> **Function** in `langchain_google_vertexai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-vertexai/vectorstores/_v2_operations/text_search)

Performs text search in a Vertex AI Vector Search 2.0 Collection.

Text search performs traditional keyword/full-text search on data fields
without using embeddings.

Note: Text search does not support filters. Use semantic_search or
vector_search if you need filtering.

## Signature

```python
text_search(
    project_id: str,
    region: str,
    collection_id: str,
    search_text: str,
    data_field_names: List[str],
    num_neighbors: int,
    credentials: Optional[Credentials] = None,
) -> List[dict[str, Any]]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | `str` | Yes | The GCP project ID. |
| `region` | `str` | Yes | The GCP region. |
| `collection_id` | `str` | Yes | The collection ID. |
| `search_text` | `str` | Yes | Keyword search query text. |
| `data_field_names` | `List[str]` | Yes | List of data field names to search in (e.g., ["title", "description"]). |
| `num_neighbors` | `int` | Yes | Number of neighbors to return. |
| `credentials` | `Optional[Credentials]` | No | Optional credentials to use. (default: `None`) |

## Returns

`List[dict[str, Any]]`

List of search results with doc_id, score, and metadata.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/vertexai/langchain_google_vertexai/vectorstores/_v2_operations.py#L415)