Skip to content

Explain the search result cache under Azure AI Search in V2 admin - #1665

Merged
Paul Lizer (paullizer) merged 4 commits into
paullizer-react-v2-uifrom
paullizer-search-result-caching-setting
Oct 6, 2026
Merged

Paul Lizer (paullizer) merged 4 commits into
paullizer-react-v2-uifrom
paullizer-search-result-caching-setting

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Summary

  • Why: V2 Admin Settings showed enable_search_result_caching under Knowledge > Web & Research > Web Search, as a bare switch labelled with its key. It had no declared field, so the enable_* fallback scan placed it by word stems. "search" ties Web Search and Azure AI Search, and Web Search wins because it comes first in navigation order. The setting actually caches workspace document searches against Azure AI Search, not web search. Nothing on the page told an admin what it did or whether to leave it on.
  • What: It is now declared in a new Search result cache group in Knowledge > Search Index > Azure AI Search, directly after the Connection group. The help text explains what is cached and what forces a fresh search. It also says each cached hit is re-checked against the requesting user's access, and when to turn caching off. The group also exposes search_cache_ttl_seconds as Cache lifetime (seconds): 60 to 3,600, default 300, shown only while caching is on. The runtime already read this value, but no interface could edit it.
  • Default stays On, with no migration. It already defaults to on in functions_settings.py and in the utils_cache.get_cache_settings() fallback. A cache hit skips the query embedding and one semantic-ranked hybrid query per in-scope index, and it returns the same sources for the same question. Reuse is safe because the cache key includes a fingerprint of every in-scope document (id, version, content screening state). If an admin has already saved it as Off, that value is kept.
  • Docs:
    • docs/admin/knowledge.md explains the cache, lists both settings, and adds a troubleshooting row.
    • The misfiled row is removed from docs/admin/scale.md.
    • Adds a fix doc, a feature doc note, and a v0.261.262 release note.

V2 Admin Settings: the Search result cache group under Azure AI Search, with caching on and a 300 second lifetime

After: rendered by the new Playwright test from the built SPA, using the real field schema and synthetic fixture settings.

Notes for reviewers

  • Both keys are V2-only and recorded in V2_ONLY_FIELDS. The classic Azure AI Search card briefly had a control in late 2025, but the classic save handler never stored it and the control was removed. The classic page is unchanged, and the new functional test fails if a classic form starts submitting either key.
  • The lifetime's unit is in its label because number controls do not render suffix; only range controls do.
  • This branch merged the latest V2 (Fix V2 admin Web Search test failing for saved Foundry connections #1662, Hide always-on tabular preflight switches from V2 Admin Settings #1663) and moved from 0.261.260 to 0.261.262, following the usual merge-and-renumber pattern. Both upstream release note sections are kept, with this one on top.

Linked issue

N/A, there is no associated issue. The investigation found two existing search cache problems. This PR doesn't change them, but each is worth its own issue:

  • invalidate_group_search_cache and invalidate_public_workspace_search_cache filter on CONTAINS(c.doc_scope, <id>), but doc_scope stores only the scope name. So they delete nothing, unless the group call passes document_id. Document fingerprints still keep results correct. The cache lifetime is what bounds staleness for changes that do not alter a document's version.
  • The search_cache container has no Cosmos TTL: config.py sets none, and the Bicep and Terraform templates set it to null. An expired entry is deleted only when the same search is read again or an invalidation happens to match it. Entries for searches that are never repeated accumulate.

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only (0.261.261 -> 0.261.262)
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Testing / validation

All results are from the merged tree: this branch plus V2 at d2d7b1d44. npm ci ran once before the merge, and the merge did not change the lockfile.

From functional_tests/:

Command Result
python test_search_result_cache_admin_setting.py (new) Passed, 7/7
python test_v2_admin_capability_placement.py Passed, 8/8
python test_v2_admin_nested_setting_reads.py Passed, 8/8
python test_v2_admin_secret_field_handling.py Passed, 10/10
python test_admin_settings_fields_registry_integrity.py Passed, 5/5
python test_v2_admin_knowledge_web_research.py Passed, 9/9
python test_v2_admin_knowledge_extraction.py Passed, 9/9
python test_v2_admin_knowledge_audio_video.py Passed, 9/9
python test_v2_admin_knowledge_file_sync.py Passed, 9/9
python test_v2_admin_schema_vocabulary.py Passed, 10/10
python test_v2_admin_settings_normalization.py Passed, 15/15
python test_v2_admin_field_renderer_coverage.py Passed, 4/4
python test_v2_admin_settings_layout.py Passed, 5/5
python test_shared_ai_connections_admin_schema.py Passed
python test_docs_app_surface_coverage.py Passed, 7/7
python test_docs_site_quality.py Passed, 6/6

From the repo root:

Command Result
python scripts\build_docs_inventory.py --check Passed, inventory in sync
python -m pytest functional_tests/test_search_result_cache_admin_setting.py functional_tests/test_v2_admin_capability_placement.py -q -p no:cacheprovider Passed, 15
npm --prefix application/v2_ui ci --no-audit --no-fund --loglevel=error Passed
npm --prefix application/v2_ui run build Passed (tsc -b and vite build)
python -m pytest ui_tests/test_v2_admin_search_result_cache.py ui_tests/test_v2_admin_settings_wide_layout.py -q -p no:cacheprovider Passed, 18 (local Chromium)

Four tests already fail and are unrelated to this change. Each fails the same way on V2 d2d7b1d44 without this branch, checked in a clean worktree from functional_tests/:

  • python test_v2_admin_settings_schema.py: 10/11. The default for core-plugin-toggles.m365_trusted_download_hosts is [], not a str.
  • python test_admin_settings_nav_map.py: 3/4. The content-screening tab has no matching pane.
  • python test_admin_settings_sidebar_card_parity.py: 3/4. The m365-retrieval-configuration card has no sidebar destination.
  • python test_v2_admin_security_parity.py: 7/8. Nothing claims chat_content_settings_present in content-screening.html.

Manual: reviewed the Playwright screenshot shown above.

Documentation

  • Release notes updated, or not needed
  • Feature documentation updated, or not needed
  • Fix documentation updated, or not needed

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security()) (no new routes)
  • Settings sent to non-admin frontends use sanitize_settings_for_user() (no change; only the admin field schema changed)
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS (no new browser assets)
  • No secrets, keys, connection strings, or local-only artifacts are included

Paul Lizer (paullizer) and others added 4 commits October 6, 2026 14:22
The V2 fallback scan filed enable_search_result_caching under Web Search as a
bare key-named switch, because "search" tied Web Search and Azure AI Search
and Web Search comes first in navigation order. Declare it in a "Search result
cache" group of azure-ai-search-section with help that explains what is
cached, what forces a fresh search, and why to leave it on, and add the
previously uneditable cache lifetime (search_cache_ttl_seconds, 60-3600 s,
shown only while caching is on). Both are recorded as V2-only.

Caching stays on by default. Docs move the setting from Scale to Knowledge,
and version is 0.261.260.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… to 0.261.262

#1662 merged as 0.261.260, the number this branch had taken, and #1663 as
0.261.261. Both release note sections are kept, with this branch's on top.
The fix doc, feature doc note, test headers and the new check's
assert_app_version_at_least move to 0.261.262. The capability placement test
keeps #1663's forced tabular parity check and this branch's relocation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… to 0.261.263

#1664 merged as 0.261.262, the number this branch had taken. Both release
note sections are kept, with this branch's on top. The fix doc, feature doc
note, test headers and the new check's assert_app_version_at_least move to
0.261.263.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit a8179f5 into paullizer-react-v2-ui Oct 6, 2026
11 checks passed
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 6, 2026
…Indexer deployer fix to 0.261.264

Resolve the config.py VERSION, release notes, and fixes index conflicts. The base
already used 0.261.260 through 0.261.263, so this fix moves to 0.261.264 in its
release notes section, fix document, deployer READMEs, preflight script header, and
test headers. The base's own 0.261.260 Web Search entry is unchanged. Deployer
version stays 1.0.33 because no incoming commit changed deployers/.

Refs #1666

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 6, 2026
… Enhanced Extraction section to 0.261.265

Resolve the conflicts with paullizer-react-v2-ui, keeping both sides:

- config.py: VERSION 0.261.265, after 0.261.264 on the base.
- release_notes.md: this change on top as v0.261.265.
- SettingsSection.tsx: pass both fieldsByKey (#1662) and runtimeFlags to
  isFieldVisible; the open_until_set reader passes fieldsByKey too.
- test_v2_admin_section_logic.ts: both header lines, both imports and both
  sets of appended checks.
- test_v2_admin_capability_placement.py: header version.

#1662 renamed readDependencyValue to readSettingValue, which the text merge
did not flag, so applyEnableEffect now calls readSettingValue.

Renumber this change's own 0.261.260 references to 0.261.265. The base's
0.261.260 (the Web Search nested settings fix) is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 6, 2026
…ber the File Sync single card to 0.261.266

Keep both sides of each conflict: the group `anchor` descriptor alongside
`open_until_set`, both new vocabulary and section-logic checks, and both
Knowledge doc entries. Anchored panels and their placement now pass the
field index and runtime flags, and use the open-until-set group reader,
the same way the base's card body does.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 6, 2026
, #1671, #1674) and renumber the Operations settings parity to 0.261.269

Conflict resolutions:
- admin_settings_fields.py: keep the full Operations block. The Application
  Insights and Health Check declarations #1670 added beside Appearance are
  superseded by it, and its mixed-source telemetry switch moves into the
  Operations Application Insights section, after the global logging readouts.
  Keep #1668's on_enable documentation and both sides' V2_ONLY_FIELDS entries.
- route_backend_v2.py: fold content_understanding_supported into
  _build_runtime_flags.
- SettingsSection.tsx, AdminSettingsPage.tsx, adminFields.ts: keep both the
  section guide and runtimeFlags props, and on_enable beside the Operations
  field properties.
- operations.md, release_notes.md and tests: keep both sides. Both
  enable_dai_debug and enable_mixed_source_development_telemetry are documented
  rather than exempted, and Workspaces and Operations are both fully described.
- Renumber this branch's 0.261.260 references to 0.261.269; the base's own
  0.261.260 Web Search fix references are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Oct 7, 2026
…rosoft#1665, microsoft#1667, microsoft#1668) and renumber the mixed-source settings fix to 0.261.266

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant