-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated tests Combine search queries with union Performance is inconsitent and often bad without limiting the span of the search headline. It might need to be limited further. The count query (caused by pagination) is often slow too. This should be investigated to see if a simpler query could provide the count. Most fields are removed from the template, as we're working towards a simpler page anyway. First stab at search weighting and normalization Small cleanups Store weights in generated documentfile.search_vector This stores the correct weighted vector, and includes the document description that was missing. backup for code fixed tests
- Loading branch information
1 parent
b248001
commit 7303de3
Showing
10 changed files
with
185 additions
and
78 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,5 @@ app/media/ | |
/logging/ | ||
/pdf_uploads/ | ||
/pdf_upload_completed/ | ||
/tmp/ | ||
/tmp/app_punt_env |
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
27 changes: 27 additions & 0 deletions
27
app/general/migrations/0012_alter_documentfile_search_vector.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,27 @@ | ||
# Generated by Django 5.0.6 on 2024-07-24 12:00 | ||
|
||
import django.contrib.postgres.search | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('general', '0011_alter_documentfile_options_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='documentfile', | ||
name='search_vector', | ||
), # also deletes `search_vector_trigger` and general_doc_search__752b22_gin | ||
migrations.AddField( | ||
model_name='documentfile', | ||
name='search_vector', | ||
field=models.GeneratedField(db_persist=True, expression=django.contrib.postgres.search.CombinedSearchVector(django.contrib.postgres.search.CombinedSearchVector(django.contrib.postgres.search.SearchVector('title', config='english', weight='A'), '||', django.contrib.postgres.search.SearchVector('description', config='english', weight='B'), django.contrib.postgres.search.SearchConfig('english')), '||', django.contrib.postgres.search.SearchVector('document_data', config='english', weight='C'), django.contrib.postgres.search.SearchConfig('english')), null=True, output_field=django.contrib.postgres.search.SearchVectorField()), | ||
), | ||
migrations.AddIndex( | ||
model_name='documentfile', | ||
index=django.contrib.postgres.indexes.GinIndex(fields=['search_vector'], name='general_doc_search__752b22_gin'), | ||
), | ||
] |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SECRET_KEY='django-insecure-w!h85bp^$e8gm%c23r!0%9i7yzd=6w$s&ic+6!%306&kj8@k*5' | ||
|
||
#DEBUG='True' | ||
|
||
ALLOWED_HOSTS='localhost 127.0.0.1 admin' | ||
USE_X_FORWARDED_HOST='True' | ||
CSRF_TRUSTED_ORIGINS="http://localhost" | ||
|
||
DB_HOST='terminology-db' | ||
DB_PORT=5432 | ||
DB_NAME='term_db' | ||
DB_USER='django' | ||
DB_PASSWORD='bogom' |