弹性搜索中多匹配查询中的比较运算符

时间:2018-09-06 06:24:07

标签: java elasticsearch

我想过滤一个弹性搜索查询,以查找大于或小于特定金额的员工薪水。过滤后的查询应该是什么?

{
    "from": 0,
    "size": 24,
    "query": {
        "bool": {
            "must": {
                "multi_match": {
                    "query": "claims",
                    "fields": ["Employee"],
                    "fuzziness": "AUTO"
                }
            }
        }
    },
    "highlight": {
        "type": "unified",
        "fields": {
            "*": {}
        }
    }
}

1 个答案:

答案 0 :(得分:0)

您可以使用类似的方法进行范围查询,

   For accessing this three variable have created below method :-
   Last_Msg_Detail last_record_t = new Last_Msg_Detail();
   public Last_Msg_Detail get_last_msgand_time_stamp(String groupID){
    List<Last_Msg_Detail> last_record = 
    chat_messageDao.get_last_msg_ID_timestamp(groupID);
    last_record_t = last_record.get(0);
    return last_record_t;
   } 
On Rebuilding Project, getting follow error 
 1. error: Cannot figure out how to save this field into database. You can 
 consider adding a type converter for it.
 2. error: Not sure how to convert a Cursor to this method's return type

Kindly advise how to resolve.