我想過濾我的類的私有布爾值,所以它只顯示非私有的資源,但它不適合我。 (我極力貶低代碼)彈性搜索/輪胎:如何過濾布爾屬性?
mapping do
indexes :private, type: "boolean"
indexes :name, type: "string"
end
end
def self.search(params)
tire.search(load: true, page: params[:page], per_page: 20) do
query { string params[:query] } if params[:query].present?
# So far I've tried...
# filter :bool, :private => ["false"]
# filter :bool, private: false
end
end
我該如何正確執行此操作?