Make your first search

Find what you indexed in seconds.


Prerequisites

Use your public key for search. It is safe to use in the browser.


Search for a painting

We are searching the paintings collection for a short query. Try your own words and see what comes back.

import { Etoile } from "@etoile-dev/client";

const etoile = new Etoile({
publicKey: process.env.ETOILE_PUBLIC_KEY,
});

const { results } = await etoile.search({
query: "night sky painting",
collections: ["paintings"],
limit: 5,
});

Response

{
"query": "night sky painting",
"results": [
  {
    "external_id": "starry-night",
    "title": "The Starry Night",
    "collection": "paintings",
    "metadata": {
      "artist": "Vincent van Gogh",
      "year": "1889",
      "url": "/paintings/starry-night"
    },
    "score": 0.94
  }
]
}

Next