mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-12 22:23:01 +02:00
@ -15,6 +15,7 @@ from onyx.document_index.vespa_constants import METADATA_LIST
|
|||||||
from onyx.document_index.vespa_constants import SOURCE_TYPE
|
from onyx.document_index.vespa_constants import SOURCE_TYPE
|
||||||
from onyx.document_index.vespa_constants import TENANT_ID
|
from onyx.document_index.vespa_constants import TENANT_ID
|
||||||
from onyx.utils.logger import setup_logger
|
from onyx.utils.logger import setup_logger
|
||||||
|
from shared_configs.configs import MULTI_TENANT
|
||||||
|
|
||||||
logger = setup_logger()
|
logger = setup_logger()
|
||||||
|
|
||||||
@ -59,7 +60,8 @@ def build_vespa_filters(
|
|||||||
|
|
||||||
filter_str = f"!({HIDDEN}=true) and " if not include_hidden else ""
|
filter_str = f"!({HIDDEN}=true) and " if not include_hidden else ""
|
||||||
|
|
||||||
if filters.tenant_id:
|
# If running in multi-tenant mode, we may want to filter by tenant_id
|
||||||
|
if filters.tenant_id and MULTI_TENANT:
|
||||||
filter_str += f'({TENANT_ID} contains "{filters.tenant_id}") and '
|
filter_str += f'({TENANT_ID} contains "{filters.tenant_id}") and '
|
||||||
|
|
||||||
# CAREFUL touching this one, currently there is no second ACL double-check post retrieval
|
# CAREFUL touching this one, currently there is no second ACL double-check post retrieval
|
||||||
|
@ -54,6 +54,7 @@ def admin_search(
|
|||||||
query = question.query
|
query = question.query
|
||||||
logger.notice(f"Received admin search query: {query}")
|
logger.notice(f"Received admin search query: {query}")
|
||||||
user_acl_filters = build_access_filters_for_user(user, db_session)
|
user_acl_filters = build_access_filters_for_user(user, db_session)
|
||||||
|
|
||||||
final_filters = IndexFilters(
|
final_filters = IndexFilters(
|
||||||
source_type=question.filters.source_type,
|
source_type=question.filters.source_type,
|
||||||
document_set=question.filters.document_set,
|
document_set=question.filters.document_set,
|
||||||
|
Reference in New Issue
Block a user