zetkin / organize.zetk.in

Organizer front-end of the Zetkin system for organizing activism
21 stars 14 forks source link

Implement full support for survey filters #565

Open richardolsson opened 7 years ago

richardolsson commented 7 years ago

Only very simple UI has been implemented for the survey-based query filters. For example, there is no way of changing the operator on SurveyOptionFilter, or selecting multiple options. In SurveyResponseFilter, a single question can't be selected (only entire surveys).

richardolsson commented 6 years ago

From the query DSL documentation:

Survey responses (survey_response)

The survey response selection includes people based on a free text search of responses to survey questions.

{
    "type": "survey_response",
    "config": {
        "operator": "in",
        "survey": 2,
        "value": "foobar"
    }
}

The operators are (all operators are case insensitive):

When survey is specified, all responses in that survey will be searched. Replace the survey attribute with the question attribute, the value of which is the ID of the question, to limit the matching to a single question.