From eda82780de0a6619dfbd36ebed1900d836405748 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 6 Jun 2023 16:19:13 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20searchFilters=20meta=20prop?= =?UTF-8?q?erty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/api/endpoints/meta.ts | 4 ++-- packages/backend/src/server/nodeinfo.ts | 3 +++ packages/client/src/scripts/search.ts | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 14256eb7b..f6c978b2d 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -323,7 +323,7 @@ export const meta = { optional: false, nullable: false, }, - elasticsearch: { + searchFilters: { type: "boolean", optional: false, nullable: false, @@ -521,7 +521,7 @@ export default define(meta, paramDef, async (ps, me) => { recommendedTimeline: !instance.disableRecommendedTimeline, globalTimeLine: !instance.disableGlobalTimeline, emailRequiredForSignup: instance.emailRequiredForSignup, - elasticsearch: config.elasticsearch ? true : false, + searchFilters: config.meilisearch ? true : false, hcaptcha: instance.enableHcaptcha, recaptcha: instance.enableRecaptcha, objectStorage: instance.useObjectStorage, diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index 2a0e1981a..18e04f420 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -82,6 +82,9 @@ const nodeinfo2 = async () => { disableRecommendedTimeline: meta.disableRecommendedTimeline, disableGlobalTimeline: meta.disableGlobalTimeline, emailRequiredForSignup: meta.emailRequiredForSignup, + searchFilters: config.meilisearch ? true : false, + postEditing: meta.experimentalFeatures?.postEditing || false, + postImports: meta.experimentalFeatures?.postImports || false, enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, diff --git a/packages/client/src/scripts/search.ts b/packages/client/src/scripts/search.ts index 03f61f1f0..a0382532f 100644 --- a/packages/client/src/scripts/search.ts +++ b/packages/client/src/scripts/search.ts @@ -1,6 +1,7 @@ import * as os from "@/os"; import { i18n } from "@/i18n"; import { mainRouter } from "@/router"; +// import { instance } from "@/instance"; export async function search() { // const searchOptions = @@ -14,6 +15,8 @@ export async function search() { // "filter:following => show results only from users you follow\n" + // "filter:followers => show results only from followers\n"; + // const searchFiltersAvailable = instance.searchFilters; + const { canceled, result: query } = await os.inputText({ title: i18n.ts.search, placeholder: i18n.ts.searchPlaceholder,