在数据检索的应用场景中,经常出现高级检索的功能需求,指定不同的字段与不同的逻辑关系,对数据进行检索。在某些应用场景中,会要求按照检索条件的顺序进行数据查找。 为解决按照检索添加出现的顺序进行检索的需求,本文使用 Elasticsearch 的 DSL 进行数据测试。 按照高级检索中检索条件出现的顺序进行条件处理,并约定如果两个检索条件之间选择‘与’关系,则取交集, 如果两个检索条件之间选择‘或’关系,则取并集。 下面优先初始化信息,并根据不同的检索条件,编写对应的 DSL 脚本,并同时满足上述约定。 public Student(String id, String studentName, String studentNo, Integer studentAge, String studentBirth, String studentIntro, String studentTags, BigDecimal gradePoint) { this.id = id; this.studentName = studentName; this.studentNo = studentNo;...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile