eleasticsearch学习笔记(未完)

按某个字段排序
res = UndergraduateStudent.search(query: {bool: {must: [{ terms: { grid_id: grid_ids } }]}},sort: { grid_id: { order: “asc” }}).page(page.to_i).per(per_page.to_i)
涉及按时间排序
res=MonitorEvent.search query:{bool: {must: [ {term: {sno: sno}}, {range: { current_time: { gte: start_time,lte:end_time} } } ] }},sort:{current_time:{order:”desc”}}
搜索时间范围
res = MonitorEvent.search query: {bool: {must: [{ terms: { grid_id: grid_ids } },{range: { current_time: { gte: start_time,lte:end_time} } }]}}

你可能感兴趣的:(redis学习笔记,学习笔记)