DimagiPilot -Case filtering issues

Taking to the commcare-developers list.

I believe in order to index a nonstandard property you have to add the
domain to the list of ES_CASE_FULL_INDEX_DOMAINS in settings.


··· On Fri, Sep 20, 2013 at 5:49 AM, Simon Kelly wrote:

Hi Marcin

I don’t have a lot of experience using Elasticsearch but I’ve found it
useful to query directly and inspect the output. It is possible that the
pp_case_filter isn’t getting into the ES index.

Yedi or Mike, do you guys have any more insight or suggestions?


On Thu, Sep 19, 2013 at 3:30 PM, Marcin Sienkiewicz < msienkiewicz@soldevelo.com> wrote:

Hi Simon,
I have some technical issues with filtering cases in reports - I already
created my custom filter to sort output records based on 'pp_case_filter’
value in case, here is the sample code(It looks similar to the
field_management in submodules/hsph-reports):

def case_filter(self):
    filters = [{'term': {'pp_case_filter': 1}}]

    return {'and': filters} if filters else {}

But every time when I use such condition I got blank result, It looks
like it doesn’t have this field(I inspected database, and there are
documents which contain those field). I wonder if it isn’t a problem with
the Elasticsearch, It looks like there is no such field stored in. I
believe that creating custom query/couch view isn’t best solution to this
problem. Maybe you have some useful suggestions?

Best Regards,

Simon Kelly
Senior Engineer | Dimagi South Africa