

elasticsearch Java High Level REST Client 7.15 实现复杂搜索
source link: https://www.oschina.net/question/2303434_2324363
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

elasticsearch Java High Level REST Client 7.15 实现复杂搜索
我在使用elasticsearch Java High Level REST Client 7.15 实现一个搜索的时候遇到了问题
有一个业务场景如下:
在es的一个index中的对象结构如下:
[
{
"name":"....",
"age":"....",
"citys": [
{
"cityCode":"43434",
"order": 1
},
{
"cityCode":"33223",
"order": 2
},
{
"cityCode":"685656",
"order": 3
}
.....
]
},
{
"name":"....",
"age":"....",
"citys": [
{
"cityCode":"233323",
"order": 1
},
{
"cityCode":"55443",
"order": 2
},
{
"cityCode":"78787",
"order": 3
}
.....
]
}
]
查询条件为cityCode1 , cityCode2,我想达到如下搜索效果
1、在包含cityCode1 , cityCode2的对象才能被查出来
2、查询的结果中每个对象的cityCode1的order必须小于cityCode2的order
我不知道该如何构建查询条件才能达到上面的要求,请各位前辈指点迷津。
Recommend
-
33
go-elasticsearch The official Go client for Elasticsearch . Caveats We encourage you to try the package in your projects, ju...
-
39
-
13
Playing with C#9 Top-level Programs, Records and Elasticsearch.NET This post is for C# Advent Calendar 2020 organized by Matthew Groves. I...
-
21
点击上方" 程序员历小冰 ",选择“置顶或者星标” 你的关注意义重大! 熟悉 MySQL 的同学一定都知道,MySQL 对于复杂条件查询的支持并不好。MySQL 最多使用一个条件涉及的索引来过滤,然后剩余的条件只能在...
-
6
Java High-Level REST Client Reading Time: 3 minutesElasticsearch is an open-source, highly scalable full-text search and analytics engine. Using this, you can easily store, search, and analyze a large amount of...
-
5
elasticsearch通过ngram分词机制实现搜索推荐 祈雨的博客 2018-10-31 ...
-
6
Elasticsearch 是一个基于 Lucene 实现的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于 RESTful web 接口。Elasticsearch是用Java语言开发的,并作为Apache许可条款下的开放源码发布,是一种流行的企业级搜索引擎。Elasticsearch用于云计算中,能够...
-
4
一般情况下,有些搜索需求是需要根据拼音和中文来搜索的,那么在elasticsearch中是如何来实现基于拼音来搜索的呢?可以通过elasticsearch-analysis-pinyin分析器来实现。
-
7
elasticsearch实现基于拼音搜索 精选 原创 火炎炎燚 2023-01-15 12:24:15...
-
8
实战环境 elastic search 8.5.0 + kibna 8.5.0 + springboot 3.0.2 + spring data elasticsearch 5.0.2 + jdk 17 一、集成 spring data elasticsearch 1 添加依赖
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK