gpt4 book ai didi

java - 应该如何查询它是否有效? ElasticSearch Java API

转载 作者:行者123 更新时间:2023-12-02 13:12:03 25 4
gpt4 key购买 nike

我只想从一个简单的伪 SQL 查询中获取所有结果,如下所示:

[...] WHERE 'idGroups' = '7078' AND ('title' LIKE '%fuite%' OR 'tag' LIKE '%fuite%' OR 'message' LIKE '%fuite%' )

完成后:

        BoolQueryBuilder qb = QueryBuilders
.boolQuery()
.must(QueryBuilders.termQuery("idGroups", 7078))
.should(QueryBuilders.termQuery("titre", "fuite"))
.should(QueryBuilders.termQuery("tag", "fuite"))
.should(QueryBuilders.termQuery("message", "fuite"));

显然,这没有返回我想要的结果..出了什么问题?

谢谢:)

最佳答案

你能试试这个吗:

QueryBuilders
.boolQuery()
.must(QueryBuilders.termQuery("idGroups", 7078))
.should(QueryBuilders.wildcardQuery("titre", "*fuite*"))
.should(QueryBuilders.wildcardQuery("tag", "*fuite*"))
.should(QueryBuilders.wildcardQuery("message", "*fuite*")).minimumShouldMatch(1);

关于java - 应该如何查询它是否有效? ElasticSearch Java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43911310/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com