In `multi_search`, when using `q="*"`, reference j...
# community-help
m
In
multi_search
, when using
q="*"
, reference joins used in
filter_by
are not returned in the response even if explicitly requested via
include_fields
(e.g.
*, $Ref_collection(*)
). The same query works in single search, and also works in
multi_search
when a non-wildcard or search query keyword is used. Is join hydration intentionally skipped for wildcard queries in
multi_search
, or is there a way to force it / should this be documented? @Jason Bosco
f
Hey Mutharasu, Could you provide small reproducible example like this one so we can debug this issue locally?
m
I have two collections:
jobs
(primary) and
job_interactions
(referenced). The
jobs
collection has a reference field pointing to
job_interactions
. I am filtering jobs using a reference join:
$job_interactions(id: *)
. In single search (
/collections/jobs/documents/search
), when I use
q="*"
and
include_fields="*, $job_interactions(*)"
, the
job_interactions
object is returned correctly. However, when I run the same logic in
multi_search
, the
job_interactions
object is not returned, even though the filter works and documents are returned. This happens with both
q="*"
and
q=" "
, even when the reference is explicitly requested via
include_fields
. Is reference join hydration intentionally skipped in
multi_search
, or is there a supported way to force returning the joined objects?
Collections definition: jobs collection: • id (string, primary key) • title (string) • description (string) • company_name (string) • skills (string[]) • job_type (string) • location (string) • modified_at (int64) • job_interactions (reference field → job_interactions.id) job_interactions collection: • id (string, primary key) • job_id (string) ← references jobs.id • user_id (string) • interaction_type (string) // bookmarked / applied • created_at (int64) Relationship: One job can have multiple job_interactions • jobs collection uses
job_interactions
as a referenced collection and is queried via
$job_interactions(id: *)
in
filter_by
\
Single search (WORKS): POST /collections/jobs/documents/search { "q": "_",_ _"query_by": "title,skills,company_name,description,source,location,job_type",_ _"filter_by": "id:_ || $job_interactions(id: )", _"include_fields": "_, $job_interactions(*)", "sort_by": "modified_at:desc", "per_page": 10, "page": 1 } Multi search (DOES NOT WORK): POST /multi_search { "searches": [ { "collection": "jobs", "q": "_",_ _"query_by": "title,skills,company_name,description,source,location,job_type",_ _"filter_by": "id:_ || $job_interactions(id: )", _"include_fields": "_, $job_interactions(*)", "sort_by": "modified_at:desc", "per_page": 10, "page": 1 } ] } Multi search with dummy query (STILL DOES NOT WORK): POST /multi_search { "searches": [ { "collection": "jobs", "q": " ", "query_by": "title,skills,company_name,description,source,location,job_type", "filter_by": "id:* || $job_interactions(id: )", _"include_fields": "_, $job_interactions(*)", "sort_by": "modified_at:desc", "per_page": 10, "page": 1 } ] }
f
Are you on Typesense Cloud or self-hosting?
m
self-hosted
@Jason Bosco while doing vector_query join ll work or not ?
@Kishore Nallan
f
Joins should work in vector search normally. Joining happens through filtering, so it should be completely independent of the query
m
but not working...
what could be reason
f
self-hosted
Without a reproducible example, it's hard for us to write an example ourselves. Could you provide us a bash script that reproduces the issue?