alex9smith / gdelt-doc-api

A Python client for the GDELT 2.0 Doc API
MIT License
100 stars 23 forks source link

Filters don't work #6

Closed TA-ma21 closed 3 years ago

TA-ma21 commented 3 years ago

Hello,

for me entering as keyword e.g. "Paypal" and specifying additional Filters in near / repeat does give back exactly the same data as only using the filter keyword = "Paypal". If i enter a filter in themes or domain, it seems to overrule the keyword filter...

Thanks for your help, Tanja

alex9smith commented 3 years ago

Thank you very much - this was a genuine bug which is now fixed.

If you update to 1.3.1 and run:

from gdeltdoc import GdeltDoc, Filters, near

f = Filters(
    keyword = "paypal",
    timespan = "7d"
)

f_with_near = Filters(
    keyword = "paypal",
    timespan = "7d",
    near = near(5, "paypal", "internet")
)

f_with_theme = Filters(
    keyword = "paypal",
    timespan = "7d",
    theme = "TAX_ECON_PRICE"
)

gd = GdeltDoc()

gd.article_search(f)

gd.article_search(f_with_near)

gd.article_search(f_with_theme)

you'll now get three different sets of results as expected.

TA-ma21 commented 3 years ago

Thank you works now!