Are you sure you want to filter? The attribute simply returns the first number of unique values ββfor this attribute. Therefore, if attribute1 contains colors, you will get orange, red, blue, etc. Any unique color matching your current search. Only one-sided copying does not filter the search results.
From your question, I think you want to filter some value in attribute1 and some value in attribute2. For this, your search will be more like:
facet_search = User.search do # Filter my results... with(:attribute1).equal_to("orange") with(:attribute2).equal_to("eagle") end
You can still include facet :attribute1 if you want to get unique values ββfor attribute1 to display in the user interface or something like that. Just note that the declaration: attribute1 as a facet does not filter the search.
source share