[SYNPY-1869] Add SearchIndex entity + search-management APIs; rename SchemaOrganization to Organization#1422
Draft
BryanFauble wants to merge 20 commits into
Draft
[SYNPY-1869] Add SearchIndex entity + search-management APIs; rename SchemaOrganization to Organization#1422BryanFauble wants to merge 20 commits into
BryanFauble wants to merge 20 commits into
Conversation
…SchemaOrganization to Organization Build the OOP method surface for search-management resources (TextAnalyzer, ColumnAnalyzerOverride, SynonymSet, SearchConfiguration, SearchConfigBinding) and the SearchIndex entity with autocomplete/query support, following the async-first @async_to_sync pattern with protocol classes and unit tests. Hard-rename the SchemaOrganization model to Organization (class, protocol, module helper list_json_schema_organizations -> list_organizations, files, docs, and mkdocs nav) so it consistently reads as an "Organization" that holds resources. No backwards-compatible alias.
…ne_keys
- Return SearchIndex children from sync_from_synapse/walk/get_children by
adding searchindex dispatch to StorableContainer and searchindexes fields
on Project and Folder
- Include searchindex in access_control ENTITY_TYPE_MAPPING so ACL/permission
cascades reach SearchIndex children
- Replace `{k: v ... if v is not None}` comprehensions with delete_none_keys()
in search_services list functions
- Fix async docstring examples in search_index to use async form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Two related gaps in the OOP model layer:
SearchIndex / search-management surface was incomplete. The
SearchManagementControllerin Synapse-Repository-Services exposes a family of resources —SearchIndex(an OpenSearch index built from a defining SQL query), plus the configuration resources that control how indexes are built:TextAnalyzer,ColumnAnalyzerOverride,SynonymSet,SearchConfiguration, andSearchConfigBinding— as well as index query and autocomplete endpoints. The Python client only had a partial, not-fully-correct starting point for these.SchemaOrganizationnaming was inconsistent. The model that holds JSON-schema resources was namedSchemaOrganization, but conceptually it's just an "Organization" that holds resources. The name should read consistently.Solution:
Search management (new):
SearchIndexentity model (models/search_index.py) following the async-first@async_to_syncpattern —store/get/delete/autocomplete, columns derived read-only fromdefining_sql, registered concrete typeorg.sagebionetworks.repo.model.search.table.SearchIndex.models/search_management.py):TextAnalyzer,ColumnAnalyzerOverride,SynonymSet,SearchConfiguration,SearchConfigBinding, plus query/autocomplete request+hit types.api/search_services.py) and wired it intoapi/__init__.py.concrete_types.py,entity_factory.py,mixins/asynchronous_job.py, and markedSearchIndexread-only-schema inmixins/table_components.py.Rename (hard, no back-compat alias):
SchemaOrganization→Organization(class +SchemaOrganizationProtocol→OrganizationProtocol), module helperlist_json_schema_organizations→list_organizations.git mvto preserve history:models/schema_organization.py→models/organization.py, the unit/integration test modules, anddocs/reference/experimental/{async,sync}/schema_organization.md→organization.md; updatedmkdocs.ymlnav.models/__init__.py,operations/{store,delete}_operations.py, mixins, curator extension, and the deprecatedservices/json_schema.pydocstring pointers.JsonSchemaOrganizationclass inservices/json_schema.pyis intentionally left unchanged — it is a separate deprecated API, not the model being renamed.Testing:
Organization; existing store/delete/factory routing unit tests updated for the rename.142 passedacross json_schema services, organization, search-management, and store/delete operations.SearchIndex(create/retrieve, match-all query, autocomplete, delete) — kept minimal to limit CI/Synapse-server load; index-creation tests skip gracefully on a 403 where creation is restricted.ruffandblackclean on all changed files (the 2 remainingF841flags in the renamed org test module and the json_schema tutorial are pre-existing debt, left untouched per surgical-change scope).