mysociety / popit-api

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
17 stars 3 forks source link

Issue searching post on production version of popit API #144

Closed sweemeng closed 9 years ago

sweemeng commented 9 years ago

We are having problem finding post using the search API on our popit instance hosted in mysociety.

Here is a sample query using python with the requests library.

In [1]: import requests

In [2]: requests.get("https://sinar-malaysia.popit.mysociety.org/api/v0.1/search/posts?q=organization_id:53633b5a19ee29270d8a9ecf").json()
Out[2]: {u'has_more': False, u'page': 1, u'per_page': 30, u'result': [], u'total': 0}

I tested on the same instance by searching an organization, it works

In [4]: requests.get("https://sinar-malaysia.popit.mysociety.org/api/v0.1/search/organizations?q=id:53633b5a19ee29270d8a9ecf").json()

Both the organization and post exist in the popit.

chrismytton commented 9 years ago

@sweemeng Seems that the posts weren't indexed in Elasticsearch properly. Not sure quite how that happened but I've re-indexed your instance now and the search is returning the results for posts correctly now. Sorry about that! Let me know if you see anymore weirdness.

https://sinar-malaysia.popit.mysociety.org/api/v0.1/search/posts?q=organization_id:53633b5a19ee29270d8a9ecf