From 06245fee984c8f2964978c04be00e14b96f65f72 Mon Sep 17 00:00:00 2001 From: adrinr Date: Wed, 15 Mar 2023 20:02:48 +0100 Subject: [PATCH] Make includeDocs private --- packages/backend-core/src/db/lucene.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/backend-core/src/db/lucene.ts b/packages/backend-core/src/db/lucene.ts index a9f54cb79a..dd9de20400 100644 --- a/packages/backend-core/src/db/lucene.ts +++ b/packages/backend-core/src/db/lucene.ts @@ -52,7 +52,7 @@ export class QueryBuilder { bookmark?: string sortOrder: string sortType: string - includeDocs: boolean + #includeDocs: boolean version?: string indexBuilder?: () => Promise noEscaping = false @@ -78,7 +78,7 @@ export class QueryBuilder { this.limit = 50 this.sortOrder = "ascending" this.sortType = "string" - this.includeDocs = true + this.#includeDocs = true } disableEscaping() { @@ -139,7 +139,12 @@ export class QueryBuilder { } excludeDocs() { - this.includeDocs = false + this.#includeDocs = false + return this + } + + includeDocs() { + this.#includeDocs = true return this } @@ -449,7 +454,7 @@ export class QueryBuilder { let body: any = { q: this.buildSearchQuery(), limit: Math.min(this.limit, 200), - include_docs: this.includeDocs, + include_docs: this.#includeDocs, } if (this.bookmark) { body.bookmark = this.bookmark