mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-28 13:53:28 +02:00
Db search (#2235)
* k * update enum imports * add functional types + model swaps * remove a log * remove kv * fully functional + robustified for kv swap * validated with hosted + cloud * ensure not updating current search settings when reindexing * add instance check * revert back to updating search settings (will need a slight refactor for endpoint) * protect advanced config override1 * run pretty * fix typing * update typing * remove unnecessary function * update model name * clearer interface names * validated foreign key constaint * proper migration * squash --------- Co-authored-by: Yuhong Sun <yuhongsun96@gmail.com>
This commit is contained in:
@@ -2,8 +2,8 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from danswer.access.access import get_access_for_documents
|
||||
from danswer.db.document import prepare_to_modify_documents
|
||||
from danswer.db.embedding_model import get_current_db_embedding_model
|
||||
from danswer.db.embedding_model import get_secondary_db_embedding_model
|
||||
from danswer.db.search_settings import get_current_search_settings
|
||||
from danswer.db.search_settings import get_secondary_search_settings
|
||||
from danswer.document_index.factory import get_default_document_index
|
||||
from danswer.document_index.interfaces import DocumentIndex
|
||||
from danswer.document_index.interfaces import UpdateRequest
|
||||
@@ -47,13 +47,13 @@ def _sync_user_group_batch(
|
||||
|
||||
def sync_user_groups(user_group_id: int, db_session: Session) -> None:
|
||||
"""Sync the status of Postgres for the specified user group"""
|
||||
db_embedding_model = get_current_db_embedding_model(db_session)
|
||||
secondary_db_embedding_model = get_secondary_db_embedding_model(db_session)
|
||||
search_settings = get_current_search_settings(db_session)
|
||||
secondary_search_settings = get_secondary_search_settings(db_session)
|
||||
|
||||
document_index = get_default_document_index(
|
||||
primary_index_name=db_embedding_model.index_name,
|
||||
secondary_index_name=secondary_db_embedding_model.index_name
|
||||
if secondary_db_embedding_model
|
||||
primary_index_name=search_settings.index_name,
|
||||
secondary_index_name=secondary_search_settings.index_name
|
||||
if secondary_search_settings
|
||||
else None,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user