Skip to content

fix: handle union response in post_multi_search for conversations#2848

Merged
kishorenc merged 8 commits intotypesense:v31from
ozanarmagan:convo-fix-v3
Apr 20, 2026
Merged

fix: handle union response in post_multi_search for conversations#2848
kishorenc merged 8 commits intotypesense:v31from
ozanarmagan:convo-fix-v3

Conversation

@ozanarmagan
Copy link
Copy Markdown
Contributor

@ozanarmagan ozanarmagan commented Mar 25, 2026

Change Summary

POST /multi_search with union=true&conversation=true was sending empty data to the conversation model. CollectionManager::do_union() writes results as top-level hits, not a results[] array. The conversation post-processing only iterated response["results"], which doesn't exist in union responses, so the model always received [].

The fix adds a dedicated branch for the union case that reads documents from the top-level hits array and gathers vector fields from all collections involved in the union.

Test Plan

  • Started a dummy model server (test/dummy_model_server.py) that logs the full request body received from Typesense
  • Without fix: POST /multi_search?conversation=true&union=true with two searches against hnstories, the model received [] (empty data) even though the union search found hits. The response also contained "results": null
  • With fix: The model receives the hits correctly for the same request

PR Checklist

@kishorenc kishorenc merged commit 459d2b4 into typesense:v31 Apr 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants