1
這可能很簡單,但我不能解決它。我對工程類這款輪胎/ elasicsearch查詢:或查詢與輪胎/ Elastic
def self.search(params)
tire.search(load: true, page: params[:page], per_page: 8) do
query do
boolean do
must { string params[:query], default_operator: "AND" } if params[:query].present?
must { term :status, "posted" }
must { term :budget, params[:budget] } if params[:budget].present?
end
end
end
end
我需要的狀態長期是在「貼」或「關閉」,不能工作了這一點搜索。我嘗試了術語:status,[「posted」,「closed」],但是這不會返回結果,因此可能會執行AND。 請在此感謝正確的輪胎語法。 (NB在這裏找不到jason/elasticsearch字符串) 非常感謝!
謝謝,沒有發現術語與術語之間的區別是文檔 – bobomoreno 2012-07-25 10:12:59