ElsevierDev / elsapy

A Python module for use with Elsevier's APIs: Scopus, ScienceDirect, others.
http://api.elsevier.com
BSD 3-Clause "New" or "Revised" License
357 stars 141 forks source link

Filter using keywords/tags associated with an article. #58

Open aroranipun opened 3 years ago

aroranipun commented 3 years ago

Hi, This isn't really an error reporting. I need to filter my search results specifically to get articles which have certain terms as their tags/keywords but I am not sure how to do.

It will be great of someone can help with that.

Nipun

ipekdk commented 3 years ago

I have the same problem, whatever I tried, I can't get the results.

tyrael147 commented 3 years ago

I guess that there are different ways to proceed if you want to filter your search. Personally, I prefer to define the filters in the query before requesting it, for instance using this query = "ALL(agent-based) AND KEY(supply+chain) AND PUBYEAR > 2018" you already filter keywords and year of publication, just like it is done in Scopus website. Conveniently the resulting ElsSearch object has an attribute results_df that is a pandas dataframe so you can work with it. Nevertheless, I found an issue here. Despite I have a subscription, the results only have the STANDARD view (https://dev.elsevier.com/sc_search_views.html) which does not include abstract, keywords, and some other data. To obtain this additional information the parameter "view"="COMPLETE" needs to be considered in the request. I checked elsclient.py and it seems that it is not in the code so it queries 'STANDARD" by default. By adding params={"view":"COMPLETE"} to the request.get() method in line 110 of elsclient.py the issue is solved and you get full results. I am not sure if it is indeed an issue or I just do not know how to use elsapy, but this works for me. Another option is to use pybliometrics, which is another wrapper that is similar. The difference I found is that it stores data in cache and the COMPLETE and STANDARD view can be defined by the user.

Please let me know if you find this useful or if you found a solution.

Regards, Gustavo