Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store content object collections in search index [FC-0062] #35469

Merged
merged 48 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ed30ce2
feat: Add Library Collections REST endpoints
yusuf-musleh Aug 14, 2024
3d64ea4
test: Add tests for Collections REST APIs
yusuf-musleh Aug 22, 2024
931f688
chore: Add missing __init__ files
yusuf-musleh Aug 23, 2024
b2b38cb
feat: Verify collection belongs to library
yusuf-musleh Aug 23, 2024
a16b398
feat: Add events emitting for Collections
yusuf-musleh Aug 26, 2024
be39d03
chore: fix pylint errors
yusuf-musleh Aug 26, 2024
22fa791
refactor: Use convert_exceptions + update tests
yusuf-musleh Aug 29, 2024
0bf0f78
refactor: Relocate convert_exceptions, remove utils
yusuf-musleh Aug 30, 2024
45cf886
refactor: Remove Collection handlers skeleton code
yusuf-musleh Aug 30, 2024
366a7e9
refactor: Move Collections views/tests
yusuf-musleh Aug 30, 2024
504aa4f
feat: Add REST endpoints to update Components in a Collections (temp)…
pomegranited Sep 3, 2024
a2da207
refactor: pull view functionality into api
pomegranited Sep 3, 2024
aa3c1e3
temp: use temporary openedx-learning branch
pomegranited Sep 4, 2024
6ae83ba
refactor: use collection.key as ID in search records
pomegranited Sep 4, 2024
abb1eb1
refactor: use Collection.key as identifier in content_libraries
pomegranited Sep 4, 2024
0eb52cf
test: adds tests for events raised by collections api
pomegranited Sep 4, 2024
6f39767
temp: use temporary openedx-events branch
pomegranited Sep 4, 2024
bcc5cbb
fix: pass a ContentKey to the search doc handlers
pomegranited Aug 28, 2024
0e32451
feat: add tags.collections to content object search index
pomegranited Aug 28, 2024
3c6617e
temp: use openedx-events temporary branch
pomegranited Sep 5, 2024
0c29552
feat: emit CONTENT_OBJECT_ASSOCIATIONS_CHANGED
pomegranited Sep 5, 2024
e20ee24
temp: use WIP openedx-events branch
pomegranited Sep 6, 2024
9619341
test: fix test failing after changes to openedx-learning
pomegranited Sep 6, 2024
1764e87
fix: emit both CONTENT_OBJECT_ASSOCIATIONS_CHANGED and CONTENT_OBJECT…
pomegranited Sep 6, 2024
ae7926f
docs: minor comment update
pomegranited Sep 6, 2024
007f80a
fix: catch IntegrityError in create_library_collection
pomegranited Sep 6, 2024
197733b
Merge remote-tracking branch 'origin/master' into yusuf-musleh/collec…
pomegranited Sep 6, 2024
436822e
docs: replaces CONTENT_OBJECT_TAGS_CHANGED with CONTENT_OBJECT_ASSOCI…
pomegranited Sep 10, 2024
d517d80
refactor: store collections outside of tags index
pomegranited Sep 10, 2024
d312ff3
chore: updates openedx-events==9.14.0
pomegranited Sep 10, 2024
9a94316
Merge branch 'yusuf-musleh/collections-crud-rest-api' into jill/colle…
pomegranited Sep 10, 2024
66b2aa8
fix: missing import
pomegranited Sep 10, 2024
715527c
Merge branch 'master' into yusuf-musleh/collections-crud-rest-api
pomegranited Sep 10, 2024
d5aeff8
chore: updates openedx-learning==0.11.4
pomegranited Sep 11, 2024
e6b469d
refactor: Update collections crud rest api (#683)
ChrisChV Sep 11, 2024
4bc7c22
Merge branch 'yusuf-musleh/collections-crud-rest-api' into jill/colle…
pomegranited Sep 11, 2024
bd44874
test: fixed failing test after refactor
pomegranited Sep 11, 2024
bfd548b
feat: index collections when created or updated
pomegranited Sep 11, 2024
0037530
feat: adds num_children to collection index
pomegranited Sep 11, 2024
8a380a7
Merge branch 'master' into jill/collection-components-search
pomegranited Sep 12, 2024
eb78583
Merge branch 'jill/collection-components-search' into jill/reindex-co…
pomegranited Sep 12, 2024
5bdcc9e
fix: store collection.key in the document block_id field
pomegranited Sep 12, 2024
a81ea9a
fix: store library block collections as a dict in search index
pomegranited Sep 12, 2024
360ec35
fix: reindex tags + collections if no changes specified
pomegranited Sep 12, 2024
ab25e2c
Merge branch 'jill/collection-components-search' into jill/reindex-co…
pomegranited Sep 12, 2024
2c6c8cf
fix: apply library collection changes synchronously
pomegranited Sep 12, 2024
79f83d7
Merge pull request #684 from open-craft/jill/reindex-collection
rpenido Sep 12, 2024
8d9f738
Merge branch 'master' into jill/collection-components-search
ChrisChV Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content/search/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def searchable_doc_for_collection(collection) -> dict:
found using faceted search.
"""
doc = {
Fields.id: collection.key,
Fields.id: collection.id,
Fields.type: DocType.collection,
Fields.display_name: collection.title,
Fields.description: collection.description,
Expand Down
10 changes: 5 additions & 5 deletions openedx/core/djangoapps/content/search/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def setUp(self):
description="my collection description"
)
self.collection_dict = {
"id": "MYCOL",
'id': self.collection.id,
"type": "collection",
"display_name": "my_collection",
"description": "my collection description",
Expand Down Expand Up @@ -450,7 +450,7 @@ def test_index_library_block_and_collections(self, mock_meilisearch):
# Build expected docs at each stage
lib_access, _ = SearchAccess.objects.get_or_create(context_key=self.library.key)
doc_collection1_created = {
"id": "COL1",
"id": collection1.id,
"type": "collection",
"display_name": "Collection 1",
"description": "First Collection",
Expand All @@ -463,7 +463,7 @@ def test_index_library_block_and_collections(self, mock_meilisearch):
"breadcrumbs": [{"display_name": "Library"}],
}
doc_collection2_created = {
"id": "COL2",
"id": collection2.id,
"type": "collection",
"display_name": "Collection 2",
"description": "Second Collection",
Expand All @@ -476,7 +476,7 @@ def test_index_library_block_and_collections(self, mock_meilisearch):
"breadcrumbs": [{"display_name": "Library"}],
}
doc_collection2_updated = {
"id": "COL2",
"id": collection2.id,
"type": "collection",
"display_name": "Collection 2",
"description": "Second Collection",
Expand All @@ -489,7 +489,7 @@ def test_index_library_block_and_collections(self, mock_meilisearch):
"breadcrumbs": [{"display_name": "Library"}],
}
doc_collection1_updated = {
"id": "COL1",
"id": collection1.id,
"type": "collection",
"display_name": "Collection 1",
"description": "First Collection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def test_html_library_block(self):
def test_collection_with_library(self):
doc = searchable_doc_for_collection(self.collection)
assert doc == {
"id": "TOY_COLLECTION",
"id": self.collection.id,
"type": "collection",
"org": "edX",
"display_name": "Toy Collection",
Expand Down Expand Up @@ -324,7 +324,7 @@ def test_collection_with_no_library(self):
)
doc = searchable_doc_for_collection(collection)
assert doc == {
"id": "MYCOL",
"id": collection.id,
"type": "collection",
"display_name": "my_collection",
"description": "my collection description",
Expand Down