#community-help

Multi-Search Query Across Different Collections

TLDR Ahmad inquires about performing a multisearch call across different databases. Kishore Nallan provides an example but Edson adds that it's an issue when field names differ per collection.

Powered by Struct AI

1

Jan 03, 2022 (24 months ago)
Ahmad
Photo of md5-4a6338a1d6016269c9f234fc1a133144
Ahmad
07:22 AM
Hi Everyone, I want to do a multisearch call with different propertyName in multiple collections like
User: { name: "string" }, Book: { author: "string"}. 

I want to search by name in User and author in Book using multi search in 1 query. Is it possible and how ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:25 AM
Are User and Book separate collections in your example?
07:27
Kishore Nallan
07:27 AM
Here's the multi search exmaple that searches two collections at the same time: https://typesense.org/docs/0.22.1/api/documents.html#federated-multi-search

1

Jan 26, 2022 (24 months ago)
Edson
Photo of md5-73ed38073601fcb89b49414b8b2d65e9
Edson
09:55 PM
I am facing the same challenge. I want to search in two different collections but they don't have comon property names. I have the impression that Federated search at the moment only works for cases where you want to search in collections with the same field names, am i correct?

in my concrete use case i wish i could "query_by" 'name', in the brands collection, and by full_name in my 'cars' collection