Jacky Zhao
2023-08-18 569beb410b967b8511a5d18cdee74280df681d15
quartz/components/scripts/search.inline.ts
@@ -148,7 +148,6 @@
  async function onType(e: HTMLElementEventMap["input"]) {
    const term = (e.target as HTMLInputElement).value
    const searchResults = (await index?.searchAsync(term, numSearchResults)) ?? []
    console.log(searchResults)
    const getByField = (field: string): number[] => {
      const results = searchResults.filter((x) => x.field === field)
      return results.length === 0 ? [] : ([...results[0].result] as number[])