Skip to content

Variable: searchResultSchema

const searchResultSchema: ZodObject<{ count: ZodNumber; hits: ZodArray<ZodObject<{ fields: ZodRecord<ZodString, ZodUnknown>; id: ZodString; index: ZodOptional<ZodString>; score: ZodNumber; }, $strip>>; index: ZodOptional<ZodString>; query: ZodString; }, $strip>

Schema for the result of a search.

  • query: Echo of the query that was searched.
  • hits: Matching documents, most relevant first.
  • index (optional): The index searched (omitted for a universal search).
  • count: Number of hits returned.