From bdc24502524c3a2eb7230c8bc2b436cfba48f0a1 Mon Sep 17 00:00:00 2001 From: Thomas Wilkerling Date: Fri, 9 May 2025 10:46:53 +0200 Subject: [PATCH] added notes to test/types.ts --- test/types.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/types.ts b/test/types.ts index 52857eb..43a19a8 100644 --- a/test/types.ts +++ b/test/types.ts @@ -168,8 +168,8 @@ async function test_document() { const doc3: MergedDocumentSearchResults = document.search({ merge: true }); const doc4: EnrichedDocumentSearchResults = document.search({ highlight: true }); const doc5: Promise = document.searchAsync({}); - const doc6: Resolver = document.search({ resolve: false }); - const doc7: DefaultSearchResults = document.search({ pluck: "title" }); + const doc6: DefaultSearchResults = document.search({ resolve: false }).resolve(); + const doc7: DefaultDocumentSearchResults = document.search({ field: "title" }); const doc8: DefaultSearchResults = document2.search({ pluck: "meta:title" }); const doc9: DefaultDocumentSearchResults = document.searchCache({}); const doc10: Promise = document.searchAsync({ cache: true }); @@ -182,22 +182,22 @@ async function test_document() { const doc17: EnrichedResults = doc14.resolve({ enrich: true }); const doc18: EnrichedResults = doc14.and({ resolve: true, enrich: true }); const doc19: Resolver = doc14.and({ index: document, field: "title" }); - const doc20: Resolver = doc19.or({ index: document2, field: "meta:title" }); - const doc21: DefaultDocumentSearchResults = doc20.resolve(); + const doc20: Resolver = doc19.or({ index: document2, pluck: "meta:title" }); + const doc21: DefaultSearchResults = doc20.resolve(); const doc22: EnrichedResults = doc20.resolve({ enrich: true }); - // highlight on .resolve() is never supported: - //const doc23: EnrichedResults = doc20.resolve({ highlight: true }); // highlight within last resolver stage is work in progress: const doc23: EnrichedResults = doc20.and({ resolve: true, highlight: true }); const doc24: Resolver = new Resolver({ index: document }); const doc25: EnrichedResults = doc24.and({}, { index: document2, resolve: true, enrich: true }); const doc26: EnrichedResults = doc24.and({}, { index: document2 }).resolve({ enrich: true }); - // highlight on .resolve() is never supported: - //const doc27: EnrichedResults = doc24.and({}, { index: document2 }).resolve({ highlight: true }); // highlight within last resolver stage is work in progress: const doc27: EnrichedResults = doc24.and({}, { index: document2, resolve: true, highlight: true }); + // highlight on .resolve() is never supported: + // @ts-expect-error + const doc28: EnrichedResults = doc24.resolve({ highlight: true }); + // @ts-expect-error let tmp1: DocumentData = doc1[0].result[0].doc; let tmp2: DocumentData = doc2[0].result[0].doc;