change index
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -859,7 +859,7 @@ async def _top_eu_project_publication_authors(
|
||||
return []
|
||||
|
||||
publication_response = await elasticsearch.search(
|
||||
index=ESIndex.CORDIS_EU_PUBLICATIONS_WILDCARD,
|
||||
index=ESIndex.CORDIS_EU_FP7_PUBLICATIONS,
|
||||
body={
|
||||
"size": 10000,
|
||||
"_source": ["projectID", "doi", "qaProcessedDoi"],
|
||||
|
||||
@@ -208,15 +208,13 @@ async def test_top_authors_maps_works_patents_news_and_eu_projects():
|
||||
"author": {
|
||||
"id": "https://openalex.org/A2",
|
||||
"display_name": "Grace Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
},
|
||||
{
|
||||
"author": {
|
||||
"id": "https://openalex.org/A1",
|
||||
"display_name": "Ada Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -229,8 +227,7 @@ async def test_top_authors_maps_works_patents_news_and_eu_projects():
|
||||
"author": {
|
||||
"id": "https://openalex.org/A2",
|
||||
"display_name": "Grace Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
@@ -325,25 +322,14 @@ async def test_top_authors_maps_works_patents_news_and_eu_projects():
|
||||
]
|
||||
assert len(works_calls) == 1
|
||||
works_body = works_calls[0].kwargs["body"]
|
||||
assert works_body["query"]["bool"]["filter"][0]["terms"]["doi"] == [
|
||||
assert works_body["query"]["terms"]["doi"] == [
|
||||
"https://doi.org/10.1234/p1",
|
||||
"https://doi.org/10.1234/p2",
|
||||
]
|
||||
assert works_body["query"]["bool"]["filter"][1] == {
|
||||
"nested": {
|
||||
"path": "authorships.institutions",
|
||||
"query": {
|
||||
"term": {
|
||||
"authorships.institutions.id": ORG_INSTITUTION_ID,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
assert works_body["_source"] == [
|
||||
"doi",
|
||||
"authorships.author.id",
|
||||
"authorships.author.display_name",
|
||||
"authorships.institutions.id",
|
||||
]
|
||||
|
||||
|
||||
@@ -369,7 +355,7 @@ async def test_top_eu_project_authors_count_filtered_projects_by_stable_author_i
|
||||
}
|
||||
|
||||
if kwargs["index"] == config.settings.openalex_works_search_index:
|
||||
assert kwargs["body"]["query"]["bool"]["filter"][0]["terms"]["doi"] == [
|
||||
assert kwargs["body"]["query"]["terms"]["doi"] == [
|
||||
"https://doi.org/10.1/p1-a",
|
||||
"https://doi.org/10.1/p1-b",
|
||||
"https://doi.org/10.1/p2",
|
||||
@@ -385,24 +371,13 @@ async def test_top_eu_project_authors_count_filtered_projects_by_stable_author_i
|
||||
"author": {
|
||||
"id": "https://openalex.org/A1",
|
||||
"display_name": "Ada Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
},
|
||||
{
|
||||
"author": {
|
||||
"id": "https://openalex.org/A2",
|
||||
"display_name": "Grace Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
},
|
||||
{
|
||||
"author": {
|
||||
"id": "https://openalex.org/A3",
|
||||
"display_name": "External Author",
|
||||
},
|
||||
"institutions": [
|
||||
{"id": "https://openalex.org/I999"}
|
||||
],
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -415,8 +390,7 @@ async def test_top_eu_project_authors_count_filtered_projects_by_stable_author_i
|
||||
"author": {
|
||||
"id": "https://openalex.org/A1",
|
||||
"display_name": "Ada Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
@@ -429,8 +403,7 @@ async def test_top_eu_project_authors_count_filtered_projects_by_stable_author_i
|
||||
"author": {
|
||||
"id": "https://openalex.org/A1",
|
||||
"display_name": "Ada Example",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
@@ -443,8 +416,7 @@ async def test_top_eu_project_authors_count_filtered_projects_by_stable_author_i
|
||||
"author": {
|
||||
"id": "https://openalex.org/A999",
|
||||
"display_name": "Outside Author",
|
||||
},
|
||||
"institutions": [{"id": ORG_INSTITUTION_ID}],
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user