> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search with payload

> Include metadata in search results.

By default, search returns only vector IDs and similarity scores. Metadata is included with your results, because `with_payload=True` by default.

Include payload data when you:

* Need metadata to display results
* Want to avoid extra fetch requests
* Require metadata for downstream processing

Excluding payload reduces response size and network transfer time.

```python Python theme={null}
import asyncio
import random
from actian_vectorai import AsyncVectorAIClient

async def main():
    async with AsyncVectorAIClient(url="localhost:6574") as client:
        query_vector = [random.gauss(0, 1) for _ in range(128)]

        results = await client.points.search(
            "my_collection",
            vector=query_vector,
            limit=10,
            with_payload=True,
        )

        for result in results or []:
            print(
                f"ID: {result.id}, "
                f"Score: {result.score:.4f}, "
                f"Payload: {result.payload}"
            )

if __name__ == "__main__":
    asyncio.run(main())
```

```javascript JavaScript theme={null}
import { VectorAIClient } from '@actian/vectorai-client';

async function main() {
    const client = new VectorAIClient('localhost:6574');

    try {
        // Generate query vector
        const queryVector = Array.from({ length: 128 }, () => Math.random() * 2 - 1);

        // Include metadata in results (default is true)
        const results = await client.points.search(
            'my_collection',  // Collection name
            queryVector,      // Query vector
            {
                limit: 10,         // Number of results
                withPayload: true  // Include payload metadata
            }
        );

        // Display results with payload
        for (const result of results) {
            console.log(`ID: ${result.id}, Score: ${result.score}`);
            console.log(`Payload: ${JSON.stringify(result.payload)}`);
            console.log('-'.repeat(50));
        }
    } finally {
        client.close();
    }
}

main().catch(console.error);
```

Each result includes these fields:

* `id`: The unique identifier of the matching point.
* `score`: Similarity score based on distance metric.
* `payload`: Full metadata dictionary for the point.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.