Search across collections
Query multiple collections at once. Results are ranked together regardless of which collection they belong to.
import { Etoile } from "@etoile-dev/client";
const etoile = new Etoile({
apiKey: process.env.ETOILE_PUBLIC_KEY,
});
// Search paintings and artists at the same time
const { results } = await etoile.search({
query: "van gogh",
collections: ["paintings", "artists"],
});const response = await fetch("https://etoile.dev/api/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ETOILE_PUBLIC_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "van gogh",
collections: ["paintings", "artists"],
}),
});
const { results } = await response.json();curl -X POST "https://etoile.dev/api/v1/search" \
-H "Authorization: Bearer $ETOILE_PUBLIC_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "van gogh",
"collections": ["paintings", "artists"]
}'Related
- Filter by collection — search one collection
- Search (POST) — API reference