Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pmg/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_serialise_post(self):
assert_in("Blog post header", data["fulltext"])
assert_not_in("<h1>", 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()
Expand Down
Loading