FIX: Don't try to use pg headlines for semantic search. (#36)

Depends on discourse/discourse#20939.
This commit is contained in:
Roman Rizzi 2023-04-03 11:48:38 -03:00 committed by GitHub
parent 7a54455cf6
commit 333cb8f212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@ module DiscourseAi
type_filter: SEMANTIC_SEARCH_TYPE, type_filter: SEMANTIC_SEARCH_TYPE,
term: query, term: query,
search_context: guardian, search_context: guardian,
use_pg_headlines_for_excerpt: false,
) )
model = model =

View File

@ -55,7 +55,9 @@ export default {
initialize(container) { initialize(container) {
const settings = container.lookup("site-settings:main"); const settings = container.lookup("site-settings:main");
if (settings.ai_embeddings_enabled) { const semanticSearch = settings.ai_embeddings_semantic_search_enabled;
if (settings.ai_embeddings_enabled && semanticSearch) {
withPluginApi("1.6.0", initializeSemanticSearch); withPluginApi("1.6.0", initializeSemanticSearch);
} }
}, },

View File

@ -48,6 +48,7 @@ en:
ai_embeddings_semantic_related_topics: "Maximum number of topics to show in related topic section." ai_embeddings_semantic_related_topics: "Maximum number of topics to show in related topic section."
ai_embeddings_pg_connection_string: "PostgreSQL connection string for the embeddings module. Needs pgvector extension enabled and a series of tables created. See docs for more info." ai_embeddings_pg_connection_string: "PostgreSQL connection string for the embeddings module. Needs pgvector extension enabled and a series of tables created. See docs for more info."
ai_embeddings_semantic_search_model: "Model to use for semantic search." ai_embeddings_semantic_search_model: "Model to use for semantic search."
ai_embeddings_semantic_search_enabled: "Enable full-page semantic search."
reviewables: reviewables:
reasons: reasons:

View File

@ -146,3 +146,6 @@ plugins:
ai_embeddings_semantic_related_topics_enabled: false ai_embeddings_semantic_related_topics_enabled: false
ai_embeddings_semantic_related_topics: 5 ai_embeddings_semantic_related_topics: 5
ai_embeddings_pg_connection_string: "" ai_embeddings_pg_connection_string: ""
ai_embeddings_semantic_search_enabled:
default: false
client: true