cambialens / lens-api-doc

10 stars 5 forks source link

Problem while retrieving references_count in scholarly API #52

Closed MorganeMarchand closed 2 years ago

MorganeMarchand commented 2 years ago

Hi, I would like to retrieve "references_count" via scholarly API. It doesn't appear in the result. In https://docs.api.lens.org/request-scholar.html it is "reference_count" without S but it is an "unknown_fields" that way. With the S, there is no error message but the "references_count" is not in the response.

I use the following request:

{ "query": { "match": { "title": "Malaria" } }, "size": 5, "from": 0, "include": [ "title", "lens_id", "references_count" ], "sort": [ { "created": "desc" }, { "year_published": "asc" } ], "exclude": null, "scroll": null, "scroll_id": null }

Here is the result (first and last founded docs do have a references_count):

{ "total": 103478, "data": [ { "lens_id": "073-336-528-447-888", "title": "Pirikool® 300 CS, a new long-lasting capsule suspension formulation of the organophosphate insecticide pirimiphos-methyl for indoor residual spraying against pyrethroid-resistant malaria vectors" }, { "lens_id": "135-270-269-081-364", "title": "Malaria among children under 10 years in 4 endemic health areas in Kisantu Health Zone: epidemiology and transmission" }, { "lens_id": "196-803-654-382-472", "title": "Desert malaria \"Curse of the Thar Desert\" – A unique geographical endemicity of malaria and combating it with modern technology" }, { "lens_id": "130-884-615-595-777", "title": "Pediatric Participant Retention Rates in a Longitudinal Malaria Immunology Study" }, { "lens_id": "065-631-868-315-904", "title": "Prompt and precise identification of various sources of infection in response to the prevention of malaria re-establishment in China" } ], "results": 5 }

Thanks

rosharma9 commented 2 years ago

Hi @MorganeMarchand , Thanks for reporting this. We use singular reference_count for search schema and plural references_count in response schema. The references_count in response is nothing but the size of references. While we fix to provide the projection on references_count independently, I would suggest you to include the references in projection too. i.e. "include": ["title","lens_id","references","references_count"], Thank you

MorganeMarchand commented 2 years ago

Hi @rosharma9, Thank you for your answer, it works that way !