typesense / typesense/typesense

Semantic search with group_by returns no results when only vector search matches are found

Open
#2,723 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
26.6k
Forks
973
Avg merge
18h 45m
Merged PRs (30d)
4

Description

Bug Description

When using semantic search together with group_by, no results are returned if documents are found only via vector search.

Reproduction Steps

See the linked gist: https://gist.github.com/Nio-o/4ca12e5cf4c32b207f05b45731dac9c6

  • Create a collection with embeddings and a facet field (e.g. groupId)
  • Upload documents
  • Perform a semantic search on this collection using group_by: groupId
  • If keyword search returns zero results, the overall response contains zero results, even though vector search finds matches

Expected vs Actual

Expected behavior
Even if keyword search returns no results, semantic (vector) search results should still be returned, since vector search finds matching documents.

Actual behavior
No results are returned, despite vector search finding matching documents.

Environment

  • Typesense version: v30.0.rca35
  • Operating system: macOS 14.2.1
  • Client library & version: -

Schema / Configuration

The schema and configuration can be found in the link above.

Additional Context

The issue exists in v30.0.rca35, but not in v29.0.
The minimum version that reproduces the bug is v30.0.rc18.

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 linked reproduction gist and compare the semantic-search and group_by behavior between v29.0 and v30.0.rc18, where the regression first appears. Trace the path taken when keyword search has no matches but vector search does; done means the reproduction returns the vector matches while retaining group_by behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.