From bd9677278a6136d82ac9a6a7ce1599dca96a8aba Mon Sep 17 00:00:00 2001 From: michaelglenister Date: Mon, 23 Mar 2026 15:56:14 +0200 Subject: [PATCH 1/3] Increase decay of ES results --- pmg/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmg/search.py b/pmg/search.py index 9a599952..8789cbed 100644 --- a/pmg/search.py +++ b/pmg/search.py @@ -477,11 +477,11 @@ def search( "gauss": { "date": { # Scores must decay, starting at docs from 7 days ago - # such that docs 30 days ago are at 0.6. + # such that docs 30 days ago are at 0.3. # See https://www.elastic.co/blog/found-function-scoring "offset": "7d", "scale": "30d", - "decay": 0.6, + "decay": 0.3, } }, # Only apply decay to documents that have a date field. From 45e6d34ab40d01605f87e8850fc54ff85132c192 Mon Sep 17 00:00:00 2001 From: michaelglenister Date: Tue, 24 Mar 2026 13:17:52 +0200 Subject: [PATCH 2/3] Fix date format --- tests/unit/test_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_search.py b/tests/unit/test_search.py index aac25ae6..17adbfd9 100644 --- a/tests/unit/test_search.py +++ b/tests/unit/test_search.py @@ -102,7 +102,7 @@ def test_serialise_post(self): assert_in("Blog post header", data["fulltext"]) assert_not_in("

", data["fulltext"]) assert_equals(post.slug, data["slug"]) - assert_equals(post.date, data["date"]) + assert_equals(post.date.isoformat(), data["date"]) def create_post(self): post = Post() From d194dc82815c76342a7d56eb3be86fd9e66f984e Mon Sep 17 00:00:00 2001 From: michaelglenister Date: Tue, 24 Mar 2026 13:22:14 +0200 Subject: [PATCH 3/3] Don't show test coverage of third party packages --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1a9a0c8..e1db1a84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Add hosts run: echo "127.0.0.1 pmg.test" | sudo tee -a /etc/hosts - name: Run tests - run: docker compose -f docker-compose.yml -f docker-compose-test.yml run --rm web nosetests --with-coverage tests + run: docker compose -f docker-compose.yml -f docker-compose-test.yml run --rm web nosetests --with-coverage --cover-package=pmg tests - name: Setup Dev Database run: docker compose run --rm web python setup_dev_database.py - name: Setup the database Stamp Head