elasticsearch - How do i check if a field is empty or null with Tire gem on Rails -
i'm trying check tire if field null. here query on model.
def self.search(params) tire.search(load: true, match_all: {}, page: params[:page], per_page: 12) query boolean must { string params[:query], default_operator: "and" } must { term :online, true } must_not { string 'name:undefined' } must_not { term 'price:null' } end end end end must_not { term 'price:null' } code wich leads me error.
how can ?
use
must_not { |m| m.term "price", nil }
Comments
Post a Comment