我们使用hibernate search api进行弹性搜索。我在elastic search中遇到了lenient选项:https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html,但不知道如何通过hibernate搜索来设置它。
elastic search中的一些字段是boolean和range,我们不想通过它们进行搜索。
发布于 2020-07-29 14:52:52
Hibernate Search目前还没有这样的选项。
在Hibernate Search 5中,你可以通过write your whole query as JSON来利用原生选项。但是,这将要求您将所有内容都编写为JSON,而不仅仅是简单的查询字符串查询。
在Hibernate Search 6中,您可以使用write just the simple-query-string predicate as JSON来利用这个谓词中的原生选项,并继续对同一查询中的其他谓词使用Hibernate Search DSL,这应该会更方便。
如果你需要DSL中的特性,你可以创建一个JIRA ticket,如果它位于优先级列表的顶端,它将在Hibernate Search 6中被寻址。如果您在此之前需要它,您当然可以提交一个拉取请求。请注意,新功能应该进入Hibernate Search 6(主分支),而不是目前处于维护模式的Hibernate Search 5。
https://stackoverflow.com/questions/63135525
复制相似问题