qdrant / qdrant/qdrant

Strict mode: gRPC facet requests with exact=true bypass search_allow_exact=false (REST rejects them)

Open
#10,522 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted area/api bug
Dominant language
Rust
Stars
34.7k
Forks
2.7k
Avg merge
1d 18h
Merged PRs (30d)
187

Description

Current Behavior

With strict mode enabled and search_allow_exact: false, a gRPC Facet request with exact: true is accepted and runs an exact facet count. The equivalent REST request (POST /collections/{collection_name}/facet with "exact": true) is correctly rejected with a strict-mode error, so REST and gRPC disagree.

Expected Behavior

Both APIs should reject exact: true when strict mode disallows exact search.

Steps to Reproduce

  1. Create a collection with "strict_mode_config": {"enabled": true, "search_allow_exact": false}.
  2. Over REST: POST /collections/{name}/facet with {"key": "<indexed_key>", "exact": true} -> strict mode error ("Exact search disabled!"). Correct.
  3. Over gRPC: Facet with exact: true -> 200 OK, exact count runs. Wrong.

Root Cause

The gRPC facet handler converts the request to FacetParams (defaults applied) and verifies that. StrictModeVerification for FacetParams::request_exact() returns None, so check_bool_opt skips the exact check. The REST handler verifies FacetRequestInternal, whose request_exact() returns self.exact, so REST enforces the setting. FacetParams already carries the resolved exact field; it just never reports it.

I have a fix with a regression test and will open a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the gRPC facet handler and its conversion to FacetParams, then inspect StrictModeVerification for FacetParams and request_exact(). Compare this path with the REST FacetRequestInternal verification and locate the existing facet strict-mode regression tests. Done means gRPC rejects exact=true with the same strict-mode behavior as REST when search_allow_exact is false.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, rust
Domain
api, backend, search
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.