Skip to content
Snippets Groups Projects
Commit ee0ffb6c authored by baermo67735's avatar baermo67735
Browse files

Labbooks that have their end date in another year than the end date are now...

Labbooks that have their end date in another year than the end date are now considered as a labbook within the year of the start date.
parent 7ad48a4e
Branches
No related tags found
No related merge requests found
......@@ -8,24 +8,12 @@ from app.elastic_search import *
def get_lab_books(es: Elasticsearch, year: int):
query = {
"query": {
"bool": {
"must": [
{
"range": {
"start": {
"lte": str(year) + "-12-31"
}
}
},
{
"range": {
"end": {
"lte": str(year) + "-12-31",
"gte": str(year) + "-01-01"
}
}
}
]
}
},
"fields": [
"name",
......@@ -97,11 +85,11 @@ def get_num_lab_books_per_year(es: Elasticsearch):
for year in range(min_year, max_year + 1):
query = {
"query": {
"bool": {
"must": [
{ "range": { "start": { "lte": str(year) + "-12-31" } } },
{ "range": { "end": { "gte": str(year) + "-01-01" } } }
]
"range": {
"start": {
"lte": str(year) + "-12-31",
"gte": str(year) + "-01-01"
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment