Kizuki
    Preparing search index...

    Function searchPassages

    • Finds the passages in one course that best match a text, by keyword and by meaning, and merges the two ranked lists. A keyword match needs at least two words of the text (one if the text has only one word); a meaning match must be closer than MAX_MEANING_DISTANCE. Returns at most limit passages, or none if nothing is related.

      Parameters

      • db: Database
      • query: {
            courseId: string;
            embed: Embedder;
            limit?: number;
            maxDistance?: number;
            text: string;
        }

      Returns Promise<SearchHit[]>