Assistance with InstantSearch and Filters


#1

Hi I’m using InstantSearch for android and am trying to setup a filter. The problem I have is that the filter does not work. Below is a copy of the code. The search returns results but the moment I select a color to filter, it does not work. All data is returned. Any clues? Thanks

searcher = Searcher.create(algoliaAppId, algoliaApiKey, "baseEntity");
 helper = new InstantSearch(this, searcher);

        filterResultsWindow = new FilterResultsWindow.Builder(this, searcher)
                .addCheckBox("color", "blue", true)
                .addCheckBox("color", "green", true)
                .addCheckBox("color", "red", true)
                .build();

        searcher.search(getIntent()).setFacet("color", true);

        buttonFilter = findViewById(R.id.btn_filter);
        buttonFilter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final boolean willDisplay = !filterResultsWindow.isShowing();
                if (willDisplay) {
                    filterResultsWindow.showAsDropDown(buttonFilter);
                } else {
                    filterResultsWindow.dismiss();
                }
                toggleArrow(buttonFilter, willDisplay);
            }
        });