> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.qdrant.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.qdrant.tech/_mcp/server.

# Search point groups

POST http://localhost:6333/collections/{collection_name}/points/search/groups
Content-Type: application/json

Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field.

Reference: https://api.qdrant.tech/v-1-18-x/api-reference/search/point-groups

## Authentication

- `api-key` header (required) — API Key authentication via header

## Servers

- `http://localhost:6333` (http, default)
- `https://localhost:6333` (https)

## Request

### Path parameters

- `collection_name` (string, required) — Name of the collection to search in

### Query parameters

- `consistency` (ReadConsistency, optional) — Define read consistency guarantees for the operation
- `timeout` (integer, optional) — If set, overrides global timeout for this request. Unit is seconds.

### Body (application/json)

This endpoint expects a SearchGroupsRequest.

- `vector` (NamedVectorStruct, required) — Vector data separator for named and unnamed modes Unnamed mode: \{ "vector": \[1.0, 2.0, 3.0] } or named mode: \{ "vector": \{ "vector": \[1.0, 2.0, 3.0], "name": "image-embeddings" } }
- `group_by` (string, required) — Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.
- `group_size` (uint, required) — Maximum amount of points to return per group
- `limit` (uint, required) — Maximum amount of groups to return
- `shard_key` (SearchGroupsRequestShardKey, optional) — Specify in which shards to look for the points, if not specified - look in all shards
- `filter` (SearchGroupsRequestFilter, optional) — Look only for points which satisfies this conditions
- `params` (SearchGroupsRequestParams, optional) — Additional search params
- `with_payload` (SearchGroupsRequestWithPayload, optional) — Select which payload to return with the response. Default is false.
- `with_vector` (SearchGroupsRequestWithVector, optional) — Options for specifying which vectors to include into response. Default is false.
- `score_threshold` (double, optional, nullable) — Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.
- `with_lookup` (SearchGroupsRequestWithLookup, optional) — Look for points in another collection using the group ids

## Response

### 200

successful operation

- `usage` (CollectionsCollectionNamePointsSearchGroupsPostResponsesContentApplicationJsonSchemaUsage, optional)
- `time` (double, optional) — Time spent to process this request
- `status` (string, optional)
- `result` (GroupsResult, optional)

## Types

### NamedVectorStruct

Vector data separator for named and unnamed modes Unnamed mode: \{ "vector": \[1.0, 2.0, 3.0] } or named mode: \{ "vector": \{ "vector": \[1.0, 2.0, 3.0], "name": "image-embeddings" } }

### SearchGroupsRequestShardKey

Specify in which shards to look for the points, if not specified - look in all shards

### SearchGroupsRequestFilter

Look only for points which satisfies this conditions

### SearchGroupsRequestParams

Additional search params

### SearchGroupsRequestWithPayload

Select which payload to return with the response. Default is false.

### SearchGroupsRequestWithVector

Options for specifying which vectors to include into response. Default is false.

### SearchGroupsRequestWithLookup

Look for points in another collection using the group ids

### ReadConsistency

Read consistency parameter Defines how many replicas should be queried to get the result * `N` - send N random request and return points, which present on all of them * `majority` - send N/2+1 random request and return points, which present on all of them * `quorum` - send requests to all nodes and return points which present on majority of them * `all` - send requests to all nodes and return points which present on all of them Default value is `Factor(1)`

### CollectionsCollectionNamePointsSearchGroupsPostResponsesContentApplicationJsonSchemaUsage

### GroupsResult

- `groups` (list of PointGroup, required)

### NamedVector

Dense vector data with name

- `name` (string, required) — Name of vector data
- `vector` (list of double, required) — Vector data

### NamedSparseVector

Sparse vector data with name

- `name` (string, required) — Name of vector data
- `vector` (SparseVector, required) — Sparse vector structure

### Filter

- `should` (FilterShould, optional) — At least one of those conditions should match
- `min_should` (FilterMinShould, optional) — At least minimum amount of given conditions should match
- `must` (FilterMust, optional) — All conditions must match
- `must_not` (FilterMustNot, optional) — All conditions must NOT match

### SearchParams

Additional parameters of the search

- `hnsw_ef` (integer, optional, nullable) — Params relevant to HNSW index Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.
- `exact` (boolean, optional, default: false) — Search without approximation. If set to true, search may run long but with exact results.
- `quantization` (SearchParamsQuantization, optional) — Quantization params
- `indexed_only` (boolean, optional, default: false) — If enabled, the engine will only perform search among indexed or small segments. Using this option prevents slow searches in case of delayed index, but does not guarantee that all uploaded vectors will be included in search results
- `acorn` (SearchParamsAcorn, optional) — ACORN search params

### Usage

Usage of the hardware resources, spent to process the request

- `hardware` (UsageHardware, optional)
- `inference` (UsageInference, optional)

### PointGroup

- `hits` (list of ScoredPoint, required) — Scored points that have the same value of the group_by key
- `id` (GroupId, required) — Value of the group_by key, shared across all the hits in the group
- `lookup` (PointGroupLookup, optional) — Record that has been looked up using the group id

### SparseVector

Sparse vector structure

- `indices` (list of uint, required) — Indices must be unique
- `values` (list of double, required) — Values and indices must be the same length

### FilterShould

At least one of those conditions should match

### FilterMinShould

At least minimum amount of given conditions should match

### FilterMust

All conditions must match

### FilterMustNot

All conditions must NOT match

### SearchParamsQuantization

Quantization params

### SearchParamsAcorn

ACORN search params

### UsageHardware

### UsageInference

### ScoredPoint

Search result

- `id` (ExtendedPointId, required) — Type, used for specifying point ID in user interface
- `version` (uint64, required) — Point version
- `score` (double, required) — Points vector distance to the query vector
- `payload` (ScoredPointPayload, optional) — Payload - values assigned to the point
- `vector` (ScoredPointVector, optional) — Vector of the point
- `shard_key` (ScoredPointShardKey, optional) — Shard Key
- `order_value` (ScoredPointOrderValue, optional) — Order-by value

### GroupId

Value of the group_by key, shared across all the hits in the group

### PointGroupLookup

Record that has been looked up using the group id

### MinShould

- `conditions` (list of Condition, required)
- `min_count` (integer, required)

### QuantizationSearchParams

Additional parameters of the search

- `ignore` (boolean, optional, default: false) — If true, quantized vectors are ignored. Default is false.
- `rescore` (boolean, optional, nullable) — If true, use original vectors to re-score top-k results. Might require more time in case if original vectors are stored on disk. If not set, qdrant decides automatically apply rescoring or not.
- `oversampling` (double, optional, nullable) — Oversampling factor for quantization. Default is 1.0. Defines how many extra vectors should be pre-selected using quantized index, and then re-scored using original vectors. For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index, and then top-100 will be returned after re-scoring.

### AcornSearchParams

ACORN-related search parameters

- `enable` (boolean, optional, default: false) — If true, then ACORN may be used for the HNSW search based on filters selectivity. Improves search recall for searches with multiple low-selectivity payload filters, at cost of performance.
- `max_selectivity` (double, optional, nullable) — Maximum selectivity of filters to enable ACORN. If estimated filters selectivity is higher than this value, ACORN will not be used. Selectivity is estimated as: `estimated number of points satisfying the filters / total number of points`. 0.0 for never, 1.0 for always. Default is 0.4.

### HardwareUsage

Usage of the hardware resources, spent to process the request

- `cpu` (integer, required)
- `payload_io_read` (integer, required)
- `payload_io_write` (integer, required)
- `payload_index_io_read` (integer, required)
- `payload_index_io_write` (integer, required)
- `vector_io_read` (integer, required)
- `vector_io_write` (integer, required)

### InferenceUsage

- `models` (map from string to ModelUsage, required)

### ExtendedPointId

Type, used for specifying point ID in user interface

### ScoredPointPayload

Payload - values assigned to the point

### ScoredPointVector

Vector of the point

### ScoredPointShardKey

Shard Key

### ScoredPointOrderValue

Order-by value

### Record

Point data

- `id` (ExtendedPointId, required) — Type, used for specifying point ID in user interface
- `payload` (RecordPayload, optional) — Payload - values assigned to the point
- `vector` (RecordVector, optional) — Vector of the point
- `shard_key` (RecordShardKey, optional) — Shard Key
- `order_value` (RecordOrderValue, optional)

### Condition

### ModelUsage

- `tokens` (uint64, required)

### RecordPayload

Payload - values assigned to the point

### RecordVector

Vector of the point

### RecordShardKey

Shard Key

### RecordOrderValue

### FieldCondition

All possible payload filtering conditions

- `key` (string, required) — Payload key
- `match` (FieldConditionMatch, optional) — Check if point has field with a given value
- `range` (FieldConditionRange, optional) — Check if points value lies in a given range
- `geo_bounding_box` (FieldConditionGeoBoundingBox, optional) — Check if points geolocation lies in a given area
- `geo_radius` (FieldConditionGeoRadius, optional) — Check if geo point is within a given radius
- `geo_polygon` (FieldConditionGeoPolygon, optional) — Check if geo point is within a given polygon
- `values_count` (FieldConditionValuesCount, optional) — Check number of values of the field
- `is_empty` (boolean, optional, nullable) — Check that the field is empty, alternative syntax for `is_empty: "field_name"`
- `is_null` (boolean, optional, nullable) — Check that the field is null, alternative syntax for `is_null: "field_name"`

### IsEmptyCondition

Select points with empty payload for a specified field

- `is_empty` (PayloadField, required) — Payload field

### IsNullCondition

Select points with null payload for a specified field

- `is_null` (PayloadField, required) — Payload field

### HasIdCondition

ID-based filtering condition

- `has_id` (list of ExtendedPointId, required)

### HasVectorCondition

Filter points which have specific vector assigned

- `has_vector` (string, required)

### NestedCondition

- `nested` (Nested, required) — Select points with payload for a specified nested field

### FieldConditionMatch

Check if point has field with a given value

### FieldConditionRange

Check if points value lies in a given range

### FieldConditionGeoBoundingBox

Check if points geolocation lies in a given area

### FieldConditionGeoRadius

Check if geo point is within a given radius

### FieldConditionGeoPolygon

Check if geo point is within a given polygon

### FieldConditionValuesCount

Check number of values of the field

### PayloadField

Payload field

- `key` (string, required) — Payload field name

### Nested

Select points with payload for a specified nested field

- `key` (string, required)
- `filter` (Filter, required)

### GeoBoundingBox

Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges

- `top_left` (GeoPoint, required) — Geo point payload schema
- `bottom_right` (GeoPoint, required) — Geo point payload schema

### GeoRadius

Geo filter request Matches coordinates inside the circle of `radius` and center with coordinates `center`

- `center` (GeoPoint, required) — Geo point payload schema
- `radius` (double, required) — Radius of the area in meters

### GeoPolygon

Geo filter request Matches coordinates inside the polygon, defined by `exterior` and `interiors`

- `exterior` (GeoLineString, required) — Ordered sequence of GeoPoints representing the line
- `interiors` (list of GeoLineString, optional, nullable) — Interior lines (if present) bound holes within the surface each GeoLineString must consist of a minimum of 4 points, and the first and last points must be the same.

### ValuesCount

Values count filter request

- `lt` (integer, optional, nullable) — point.key.length() \< values\_count.lt
- `gt` (integer, optional, nullable) — point.key.length() > values_count.gt
- `gte` (integer, optional, nullable) — point.key.length() >= values_count.gte
- `lte` (integer, optional, nullable) — point.key.length() \<= values\_count.lte

### GeoPoint

Geo point payload schema

- `lon` (double, required)
- `lat` (double, required)

### GeoLineString

Ordered sequence of GeoPoints representing the line

- `points` (list of GeoPoint, required)

## Examples

**Request**

```json
{
  "vector": [
    1.1
  ],
  "group_by": "string",
  "group_size": 1,
  "limit": 1
}
```

**Response**

```json
{
  "usage": {
    "hardware": {
      "cpu": 1,
      "payload_io_read": 1,
      "payload_io_write": 1,
      "payload_index_io_read": 1,
      "payload_index_io_write": 1,
      "vector_io_read": 1,
      "vector_io_write": 1
    },
    "inference": {
      "models": {}
    }
  },
  "time": 0.002,
  "status": "ok",
  "result": {
    "groups": [
      {
        "hits": [
          {
            "id": 42,
            "version": 3,
            "score": 0.75,
            "payload": {},
            "vector": {},
            "shard_key": "region_1",
            "order_value": 42
          }
        ],
        "id": "string",
        "lookup": {
          "id": 42,
          "payload": {},
          "vector": {},
          "shard_key": "region_1",
          "order_value": 42
        }
      }
    ]
  }
}
```

**SDK Code**

```python
from qdrant_client import QdrantClient

client = QdrantClient(url="http://localhost:6333")

client.search_groups(
    collection_name="{collection_name}",
    query_vector=[1.1],
    group_by="document_id",
    limit=4,
    group_size=2,
)

```

```java
import java.util.List;

import io.qdrant.client.QdrantClient;
import io.qdrant.client.QdrantGrpcClient;

import io.qdrant.client.grpc.Points.SearchPointGroups;

QdrantClient client = new QdrantClient(
                QdrantGrpcClient.newBuilder("localhost", 6334, false).build());

client
    .searchGroupsAsync(
        SearchPointGroups.newBuilder()
            .setCollectionName("{collection_name}")
            .addAllVector(List.of(1.1f))
            .setGroupBy("document_id")
            .setLimit(4)
            .setGroupSize(2)
            .build())
    .get();

```

```go
package client

import (
	"context"
	"fmt"

	"github.com/qdrant/go-client/qdrant"
)

func searchGroups() {
	client, err := qdrant.NewClient(&qdrant.Config{
		Host: "localhost",
		Port: 6334,
	})
	if err != nil {
		panic(err)
	}

	groupSize := uint64(2)
	results, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{
		CollectionName: "{collection_name}",
		Query:          qdrant.NewQuery(0.01, 0.45, 0.67),
		GroupBy:        "document_id",
		GroupSize:      &groupSize,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println("Query results: ", results)
}

```

```typescript
import { QdrantClient } from "@qdrant/js-client-rest";

const client = new QdrantClient({ host: "localhost", port: 6333 });

client.searchPointGroups("{collection_name}", {
    vector: [1.1],
    group_by: "document_id",
    limit: 4,
    group_size: 2,
});

```

```rust
use qdrant_client::qdrant::SearchPointGroupsBuilder;
use qdrant_client::Qdrant;

let client = Qdrant::from_url("http://localhost:6334").build()?;

client
    .search_groups(SearchPointGroupsBuilder::new(
        "{collection_name}",
        vec![1.1],
        4,
        "document_id",
        2,
    ))
    .await?;

```

```csharp
using Qdrant.Client;

var client = new QdrantClient("localhost", 6334);

await client.SearchGroupsAsync(
  collectionName: "{collection_name}",
  vector: new float[] { 1.1f },
  groupBy: "document_id",
  limit: 4,
  groupSize: 2
);

```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:6333/collections/collection_name/points/search/groups")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"vector\": [\n    1.1\n  ],\n  \"group_by\": \"string\",\n  \"group_size\": 1,\n  \"limit\": 1\n}"

response = http.request(request)
puts response.read_body
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:6333/collections/collection_name/points/search/groups', [
  'body' => '{
  "vector": [
    1.1
  ],
  "group_by": "string",
  "group_size": 1,
  "limit": 1
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "vector": [1.1],
  "group_by": "string",
  "group_size": 1,
  "limit": 1
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:6333/collections/collection_name/points/search/groups")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```