Skip to content

Conversation

@stsewd
Copy link
Member

@stsewd stsewd commented Nov 7, 2025

We used to need to do this when we had sections and sphinx domains separated, now they are merged into sections, so no need to sort the results.

@stsewd stsewd requested a review from a team as a code owner November 7, 2025 00:56
@stsewd stsewd requested a review from agjohnson November 7, 2025 00:56
Comment on lines +58 to +74
class SectionHighlightSerializer(serializers.Serializer):
title = serializers.SerializerMethodField()
content = serializers.SerializerMethodField()

def get_title(self, obj):
return list(getattr(obj, "sections.title", []))

def get_content(self, obj):
return list(getattr(obj, "sections.content", []))


class SectionSearchSerializer(serializers.Serializer):
type = serializers.CharField(default="section", source=None, read_only=True)
id = serializers.CharField()
title = serializers.CharField()
content = serializers.CharField()
highlights = SectionHighlightSerializer(source="meta.highlight", default=dict)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were just moved, as now SectionSearchSerializer needs to be defined first

@stsewd stsewd requested a review from ericholscher November 10, 2025 18:42
@stsewd stsewd merged commit 46d2203 into main Nov 11, 2025
11 checks passed
@stsewd stsewd deleted the dont-sort-results branch November 11, 2025 15:36
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.

3 participants