-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search_keywords to Community model
Add a ArrayField to the Community model to enable slitghtly more optimized search. The field stores an array of strings and matches the search query to these keywords, alongside filtering by community name. This allows users to find communities with short abbreviations or alternative stylings of community names. Add the search_keywords field to CommunityListAPIView search_fields. Implement tests with various test cases for CommunityListAPIView endpoint. Refs. TS-2350
- Loading branch information
1 parent
57cd000
commit b902f55
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
25 changes: 25 additions & 0 deletions
25
django/thunderstore/community/migrations/0034_add_search_keywords.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 3.1.7 on 2025-03-05 08:35 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("community", "0033_add_mod_manager_support_field"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="community", | ||
name="search_keywords", | ||
field=django.contrib.postgres.fields.ArrayField( | ||
base_field=models.CharField(max_length=512), | ||
blank=True, | ||
default=list, | ||
null=True, | ||
size=None, | ||
), | ||
), | ||
] |
This file contains 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