From bf6ae38fe182c0e8d83bc81934e5c9c525fc79a3 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Tue, 14 Mar 2023 15:20:09 +0800 Subject: [PATCH] Add html to the highlight document in elasticsearch --- packages/api/src/elastic/types.ts | 3 ++- packages/db/elastic_migrations/index_settings.json | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/api/src/elastic/types.ts b/packages/api/src/elastic/types.ts index 1ec528e54..6b32f0c91 100644 --- a/packages/api/src/elastic/types.ts +++ b/packages/api/src/elastic/types.ts @@ -1,6 +1,6 @@ // Define the type of the body for the Search request -import { PickTuple } from '../util' import { PubsubClient } from '../datalayer/pubsub' +import { PickTuple } from '../util' import { DateFilter, FieldFilter, @@ -210,6 +210,7 @@ export interface Highlight { labels?: Label[] highlightPositionPercent?: number | null highlightPositionAnchorIndex?: number | null + html?: string | null } export interface RecommendingUser { diff --git a/packages/db/elastic_migrations/index_settings.json b/packages/db/elastic_migrations/index_settings.json index 8671385d5..1d9c977e1 100644 --- a/packages/db/elastic_migrations/index_settings.json +++ b/packages/db/elastic_migrations/index_settings.json @@ -123,6 +123,10 @@ }, "highlightPositionAnchorIndex": { "type": "integer" + }, + "html": { + "type": "text", + "analyzer": "strip_html_analyzer" } } },